There is almost no way to actually communicate PHP and JavaScript. However, the best and simplest way is to set the ID within an attribute. The new HTML5 data attributes would be perfect.
For example, have a anchor tag with
some event
and then:
$(this).attr('href','student.php?'+$(this).attr('data-id'));
Or just use
if it is not external JS file