PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1845
Number of posts: 5013

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
HTML hyperlink pass variable to PHP Posted by jandrews on 17 Jun 2005 at 7:09 PM
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!
Report
Re: HTML hyperlink pass variable to PHP Posted by treshr on 20 Jun 2005 at 12:36 AM
What you want is to get the value from the hyperlink that looks something like this:
http://yourlocation/yourpage.php?teacher=teachersname

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.

--=][tReShR][=--




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.