Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax Problem, variables are not getting sent
    text
    copied!<p>This ajax thing im working on is not doing what i tell it to do.</p> <p>On the client JS side I alert everything that is sent through the request, and on the PHP side I print out everything that it receives. These two lists of variables are not the same. I do not understand why.</p> <p>Here how I am sending the data (over post):</p> <pre><code>xhr.onreadystatechange = response; xhr.open("POST", self.url, true); xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr.setRequestHeader("Content-length", data.length); xhr.setRequestHeader("Connection", "close"); xhr.send(data); if(self.ALERT_SENT_DATA) { alert("sending this to " + self.url + ":\n" + data); } </code></pre> <p>and the alert looks like this: (everything is zero except for type, permissionid, and permission)</p> <pre><code>sending this to workers/permission.php: type=save&amp;permissionid=2&amp;permission=1&amp;info=0&amp;users=0&amp;pages=0&amp;menus=0 &amp;toolmanager=0&amp;contributors=0&amp;currentissue=0&amp;backup=0&amp;features=0&amp;issues=0&amp;ast=0 &amp;research=0&amp;sports=0&amp;milestones=0&amp;sportslist=0&amp;crusher=0&amp;permission=0&amp;info=0 &amp;users=0&amp;pages=0&amp;menus=0&amp;toolmanager=0&amp;contributors=0&amp;currentissue=0&amp;backup=0 &amp;features=0&amp;issues=0&amp;ast=0&amp;research=0&amp;sports=0&amp;milestones=0&amp;sportslist=0&amp;crusher=0 </code></pre> <p>On the PHP side I can always get the variables type and permissionid. Those 2 always work and i do not know why. THere isnt anything special about those two except they are first. However everything else after permissionid ALWAYS comes up zero. No matter what the javascript tells me it sent, everything comes up zero on the PHP.</p> <p>So how can I get into this and figure out where my problem is?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload