jquery $.post returned data from php is empty

Posted by vee on Stack Overflow See other posts from Stack Overflow or by vee
Published on 2010-06-05T15:16:08Z Indexed on 2010/06/05 15:22 UTC
Read the original article Hit count: 243

Filed under:
|
|
|
|

hi,

i'm using this code to post to a php page:

var qreq = ".....myurl.php";
$.post(qreq, function(data){alert(data);});

in my PHP file i have this:

......
$prevtopic = $row["topic_id"];
echo $prevtopic;

the alert comes up, but is blank. for some reason data is empty even though i'm echoing from the PHP file. i also tried just echoing "hi" but that didn't work either. what am i doing wrong?

thanks.

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript