Jump to content

Get Value When Redirect Page


Xeon-YK

Recommended Posts

i have 2 php file, tes and tes2.

tes :

<form name="form1" method="post" action="tes2.php">

<?

if( !isset($msg))
{
echo "tes";
}
else
echo "tes1";

?>

<input type="text" name="textfield">
<input type="submit" name="Submit" value="Submit">
</form>
<?

?>

tes2 :

<?
header( "location: tes.php?msg=1" ) ;
?>

when i click on submit button, it will go to tes2.php and tes2.php will redirect back to tes.php and set msg=1
but when i try in my computer $msg always zero. why???
i try this in two computer, first computer work and second computer didn't work.
may be i must setting php.ini file, but i don't know to set it???

how can i solve this problem... thank....
Link to comment
https://forums.phpfreaks.com/topic/7926-get-value-when-redirect-page/
Share on other sites

[!--quoteo(post=366729:date=Apr 20 2006, 10:05 AM:name=Xeon-YK)--][div class=\'quotetop\']QUOTE(Xeon-YK @ Apr 20 2006, 10:05 AM) [snapback]366729[/snapback][/div][div class=\'quotemain\'][!--quotec--]
i have 2 php file, tes and tes2.

tes :

<form name="form1" method="post" action="tes2.php">

<?

if( !isset($msg))
{
echo "tes";
}
else
echo "tes1";

?>

<input type="text" name="textfield">
<input type="submit" name="Submit" value="Submit">
</form>
<?

?>

tes2 :

<?
header( "location: tes.php?msg=1" ) ;
?>

when i click on submit button, it will go to tes2.php and tes2.php will redirect back to tes.php and set msg=1
but when i try in my computer $msg always zero. why???
i try this in two computer, first computer work and second computer didn't work.
may be i must setting php.ini file, but i don't know to set it???

how can i solve this problem... thank....
[/quote]
change line[code]if( !isset($msg))[/code]to[code]if( !isset($_GET['msg']))[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.