Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is the problem with this ajax(with prototype)?
    primarykey
    data
    text
    <p>Hello i have the next code: php side:</p> <pre><code>&lt;?php print_r($_POST); print_r($_GET); die(); ?&gt; </code></pre> <p>In javascript:</p> <pre><code>voteAjax = function(typez, actionz, idz){ new Ajax.Request( 'http://localhost/reporeade/Vote/Ajax/?rand='+Math.random()*500000, {asynchronous:true, evalScripts:true, method:'post', parameters:'contentType='+typez+'&amp;action='+actionz+'&amp;id='+idz }); return false; } </code></pre> <p>And in some part of my html:</p> <pre><code>&lt;a class="button" onclick="voteAjax('content','up','89');"&gt; </code></pre> <p>You can see im running on localhost... the problem i have is that the POST somehow gets mixed up SOMETIMES, i get the next answer 90% of the time:</p> <pre><code>Array ( [contentType] =&gt; content [action] =&gt; up [id] =&gt; 89 ) Array ( [rand] =&gt; 449701.9597706424 ) </code></pre> <p>And the other 10% of the time i get:</p> <pre><code>Array ( ) Array ( [rand] =&gt; 468905.44804602925 ) </code></pre> <p>Now, i have tried everything, changed computer, tried on a server with a full url(thinking maybe localhost was the trouble), read somewhere that using <a href="http://localhost/reporeade/Vote/Ajax/?rand=" rel="nofollow noreferrer">http://localhost/reporeade/Vote/Ajax/?rand=</a> instade of <a href="http://localhost/reporeade/Vote/Ajax?rand=" rel="nofollow noreferrer">http://localhost/reporeade/Vote/Ajax?rand=</a> solved the trouble but tried both and really cant undertand what would make the post get lost.... any ideas?</p> <p><strong>Edit:</strong> Well after playing with all this, i got it working(like it is) in our production server, but in all of our wamp instalations it will not work(well fail like 50% of the time). Its really important for me to solve this so we can keep on developing all the ajax functionality of the product, so...</p> <ul> <li>I tried xampp but its not compatible with our framework</li> <li>I tried going to apache 2.0 instead of 2.2 in wamp</li> <li>I tried with diferent configurations of the httpd.conf and php.ini</li> </ul> <p>Any ideas of why wamp would fail like this?</p> <p><strong>Update:</strong> I'm sure the problem is the wamp instalation that is not sending the POST correctly some times, any help that would lead to solving this will get the correct answer and the bounty!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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