Re: PASSING VARIABLES...
- From: "ZeldorBlat" <zeldorblat@xxxxxxxxx>
- Date: 14 Jan 2006 13:39:13 -0800
In a link:
www.somedomain.com/dir/page.php?var1=val1&var2=val2
If the user clicks on this link, it will take them to page.php. Inside
page.php you can access the variables like this:
$var1 = $_GET['var1'];
$var2 = $_GET['var2'];
Alternatively, you can pass them in a form using the POST method. For
instance, you could accomplish the same thing as above and let the user
input the values for var1 and var2:
<form action="page.php" method="post">
<input type="text" name="var1"/>
<input type="text" name="var2"/>
<input type="submit" name="submit" value="submit"/>
</form>
So once the user fills in the form and hits submit, they'll be
redirected to page.php. On page.php you can access those values like
this:
$var1 = $_POST['var1'];
$var2 = $_POST['var2'];
.
- Follow-Ups:
- Re: PASSING VARIABLES...
- From: paul_zaoldyeck
- Re: PASSING VARIABLES...
- From: paul_zaoldyeck
- Re: PASSING VARIABLES...
- References:
- PASSING VARIABLES...
- From: paul_zaoldyeck
- PASSING VARIABLES...
- Prev by Date: Re: Help getting this debug.php script to work
- Next by Date: Re: PASSING VARIABLES...
- Previous by thread: PASSING VARIABLES...
- Next by thread: Re: PASSING VARIABLES...
- Index(es):
Relevant Pages
|