passing variable to PHP through javascript
<p>I'm kinda new to working with JS and PHP and stumbled upon a little problem. Im trying to pass the ID of a textbox I clicked through to PHP and then query a database with that ID. I tried the following code to check if the variable gets passed on, but nothing is alerted:</p>

<pre><code>&lt;script type="text/javascript"&gt;
function Like(ID)
{
&lt;?php

$id = ID;
print "alert('$id');";

?&gt;
}
&lt;/script&gt;

&lt;input type="text"  id="1" onclick="Like(this.id)" &gt;
</code></pre>

<p>What I'm trying to accomplish:</p>

<p>I've got a database of videos with a unique ID. I have 2 buttons next to each video for either liking or disliking. The 2 buttons will have an id based on the ID of the video. For example video number 2 has 2 buttons: like(id=L2) and dislike(id=D2). When the user clicks either one of those buttons, I want to update the videos table's "likes" column without the page reloading. Would that be possible?</p>
