reading external php variable with jquery
<p><br />
I'm kinda newbie on mixing jquery with php and php with jquery.<br />
I have to file script.php and test.php<br />
I manage to post variables from test.php to script.php  using jquery, but now I want to read variables from script.php into test.php<br />
my test.php is like this:<br /></p>

<pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"&gt;
&lt;/script&gt;
&lt;script type="text/javascript" &gt;
$(function() {
$(".submit").click(function() {
var like = $("#like").val();
var rid = $("#rid").val();
var dataString = 'like='+ like + '&amp;rid='+ rid;
//alert('like='+ like + 'rid='+ rid);

$.ajax({
type: "POST",
url: "script.php",
data: dataString,
success: function(){
$('.success').fadeIn(200).show();
}
});

return false;
});
});
&lt;/script&gt;
&lt;form method="post" name="form"&gt;
&lt;input type="hidden" value="3" id="rid" name="rid"&gt;
&lt;button type="submit" value="like" class="submit" id="like" name="like"&gt;test&lt;/button&gt;
&lt;span class="default"&gt; &lt;?=$value?&gt;&lt;/span&gt;
&lt;span class="success" style="display:none"&gt; You like this&lt;/span&gt;
&lt;/div&gt;&lt;/form&gt;
</code></pre>

<p>my script.php is:</p>

<pre><code>&lt;?php
if($_POST['like']=="like")
{
    require_once"dbconfig.php";
$rid=$_POST['rid'];
mysql_query("INSERT INTO likes set like_value='1', video_id='".$rid."'");
$sql=mysql_query("SELECT * FROM likes where like_value='1' and video_id='".$rid."'")or die(mysql_error());
$result=mysql_num_rows($sql);

}

?&gt;
</code></pre>

<p>I want to display the $result instead of " You like this". I'm trying to do this way because I don't want to refresh the whole page (test.php). <br />
<br />
Thank you!</p>
