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
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.