Jump to content


Photo

Get Value When Redirect Page


  • Please log in to reply
1 reply to this topic

#1 Xeon-YK

Xeon-YK
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 20 April 2006 - 08:05 AM

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

#2 sasa

sasa
  • Staff Alumni
  • Advanced Member
  • 2,804 posts
  • LocationHrvatska

Posted 20 April 2006 - 08:18 AM

[!--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) View Post[/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
if( !isset($msg))
to
if( !isset($_GET['msg']))





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users