Jump to content
MakeWebGames

Recommended Posts

Posted
//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.

Screenshot_20200825-173550.png

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 :)

  • Like 1
Posted

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.

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...