HTML hyperlink pass variable to PHP

I want to use a hyperlink to pass a variable with it to be processed by a php destination page. When someone clicks on the "SYLLABUS" button on a teacher's web page, I want the button to pass on the teacher's name to the syllabus.php page which will use that variable to search for the syllabus "where teacher =".$teacher;.

I know how to do everything except pass the teacher's identity along with the hyperlink. If anyone knows how to do this, it would have much larger implications for me. THANK YOU!


  • What you want is to get the value from the hyperlink that looks something like this:
    In the php code you use the $_GET method with the given parameter to catch the value. Eventually it'll look like this:
    $teacher = $_GET['teacher'];

    Hope this helps you out.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion