Sim Posted August 25, 2020 Posted August 25, 2020 //im directory themes/alph/js <? require "config.php"; require "class/error"; require "init.php"; global $user; die(json_encode($user->char)); ?> That file is in the themes/alph/jsl directory. Everytime I call the file it gives me a 500 error. Even if I load the file directly. I also try loading it from root folder Simm.php <? include "themes/alph/js/getStats.php"; >? The file is supposed to be called from an ajax call jq('#php__container').click(function(e){ if (jq(e.target).is('a')) { var url = e.target.href; //allows tabs to work if(url.includes("?")) { e.preventDefault(); url = url + '&loadMain=no'; jq("#php__container").load(url); update_stats(); } } function update_stats(){ alert("tester"); //it calls this jq.ajax({ url: "themes/alph/js/update.php", type: "POST", dataType: "JSON", success: function (jsonStr) { alert("tes11122r"); alert("tesr"); //alert (jsonStr); /* jq.("#charLVL").text(jsonStr.UC_lvl); jq("#charEXP").text(jsonStr.UC_exp); jq("#charAP").text(jsonStr.UC_ActionPoints + '/' + jsonStr.UC_maxActionPoints); */ jq("#stat_money").text(jsonStr.UC_cash); jq("#stat_silver").text(jsonStr.UC_silver); jq("#charAP").text(jsonStr.UC_gold); // jq("#stat_silver").text(jsonStr.UC_silver); } }); } It calls the function update_stats() as I mentioned the error 500 is avoiding any results. http://sim.makeweb.games/alph/themes/alph/js/ Both update.php and getStats.php same file. So when I click I know url isn't wrong Resolved some. Moved my php file to Root directory. Nice temporary fix :) 1 Quote
Magictallguy Posted August 26, 2020 Posted August 26, 2020 Check your error log. A 500 can be thrown for a variety of reasons - your first port of call should always be your error log Quote
SRB Posted August 26, 2020 Posted August 26, 2020 And stop using short tags - that shit is disabled on most server configuration right now, so to run your stuff - the first thing anyone has to do is break away from default configuration. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.