Skip to main content
April 4, 2007
Question

passing PHP variables to different web pages.

  • April 4, 2007
  • 1 reply
  • 262 views
I want a user to input something into a form (in this case, gold, silver or bronze) and then upon pressing submit I want the value to be sent to a PHP page where the information will be displayed. So if a user types gold a query will run and display all matches to the form on the first page, I do not want the results on the same page. This is probably quite easy but I want multiple forms on one page and then multiples PHP pages linked to the original page if that makes any sense...
This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

Günter_Schenk
Inspiring
April 4, 2007
in general the value of form elements (e.g. input fields, select menus) can be retrieved using the $_POST['formelement_name'] variable on the follow up page -- and you can also use this thing within a query, like this...

"SELECT * FROM table_name WHERE medal = '".$_POST['medal_type']."'"

>>
This is probably quite easy but I want multiple forms on one page and then multiples PHP pages linked to the original page
>>

that shouldn´t be a problem, simply use a different target page within each form´s "action" field -- e.g. action="check_medals.php"