Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass a parameter in php between 2 pages

Status
Not open for further replies.

mnassih

IS-IT--Management
Jun 29, 2005
64
SE
I want to pass a parameter $matricule from one page1.php to page2.php. What is the code in page1.php that I should have ? -I want, when I submit a form I had page2.php?matricule=176 for example.

many thanks in advance
 
There are several ways to do this. what is the best way depends on what you want to do with that variable.

You can have the from direct to page2 and append the variable onto the forms action:

Code:
<form action="page2.php?matricule=<?echo $matricule;?>">
If you know before hand where $matriocule is coming from.


Or you can make a link the same way, and have it clicked.
Code:
<a href="page2.php?matricule=<? echo $matricule; ?>">Click here</a>








----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top