Note that there are some explanatory texts on larger screens.

plurals
  1. POnot able to receive POST data in php file
    text
    copied!<p><strong>UPDATE</strong></p> <p>this is the screenshot of the alert:</p> <p><a href="http://img163.imageshack.us/img163/5078/screenshot20091222at346.png" rel="nofollow noreferrer">alt text http://img163.imageshack.us/img163/5078/screenshot20091222at346.png</a></p> <p>i am using the following JQuery function to successfully POST data to the user_submit.php file, its just that the php file is <strong>unable to receive the data.</strong></p> <pre><code> $(function() { $("#submit_js").click(function() { $.post("user_submit.php", { comment: $("#comment").val() }); }); }); </code></pre> <p>upon finishing the Firebug consoloe shows this:</p> <pre><code>&lt;html&gt; &lt;body&gt; Your vote was successfully registered!any text but this &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I am pasting the entire user_submit.php file here:</p> <pre><code> &lt;html&gt; &lt;body&gt; &lt;?php $vote = $_REQUEST['vote']; $aid = $vote; //$comment = $_REQUEST['#comment']; //$comment = print_r($_POST); $comment = htmlspecialchars($_POST["comment"]); //$comment = $_POST['comment']; //echo htmlspecialchars($comment); //$comment = $_POST['comment']; //echo $comment; // include configuration file include('config.php'); // open database connection $connection = mysql_connect($host, $user, $pass) or die('ERROR: Unable to connect!'); // select database mysql_select_db($db) or die('ERROR: Unable to select database!'); // update vote counter $query = "UPDATE answers SET acount = acount + 1 WHERE aid = $vote"; $result = mysql_query($query); $cadd = "INSERT INTO comments (comment,aid) VALUES ('$comment', '$aid')"; mysql_query($cadd); // close connection mysql_close($connection); // print success message echo 'Your vote was successfully registered!'; echo $comment; //print_r(array_count_value($comment)); ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>please help me out. i have been stuck with this for hours now.</p> <p>**EDIT: As requested the HTML for the Submit Button **</p> <pre><code>&lt;div id="greetings"&gt; You are voting out &lt;b style="color: #00b0de;" id=roadiename&gt;&lt;/b&gt;. Care to explain why?&lt;br/&gt;&lt;br/&gt; &lt;textarea name="textarea" id="comment" cols="38" rows="7"&gt;textarea&lt;/textarea&gt;&lt;br&gt; &lt;a href="#" id="submit_js"&gt;&lt;img src="images/submit.gif" style="border: none; float:right; padding-top: 10px;padding-right: 10px;"/&gt;&lt;/a&gt; &lt;/div&gt; </code></pre>
 

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