Re: isset() question

From: Date: Mon, 16 Feb 2004 00:39:17 +0000
Subject: Re: isset() question
Groups: php.windows 
Request: Send a blank email to php-windows+get-22825@lists.php.net to get a copy of this message
Anthony Ritter,Hello! Here is my test result: <html> <head> <title> Sample Page </title> </head> <body> <p>Your name: </p> <p>This paragraph contains a <a href="newpage.php?name=">link</a> that passes the name variable on to the next document.</p> </body> </html> It's all right under Apache/2.0.44 (Win32) & PHP/4.3.1.what problem you met is that you turn off the globals_register.If that,you will never get the name varibles by $name,but $_POST['name'] or $_GET['name'] or $_REQUEST['name']. Mend your code like this: <?php if (!isset($_REQUEST['name']) ): ?> May this helps you, Yong Woody ======= 2004-02-16 01:21:20 ======= >If you get a chance please run the following script _without_ entering a >name in the textbox. > >Does the same page load after you hit submit or does a different page load? > >Thank you. >TR >................... > ><html> ><head> ><title> Sample Page </title> ></head> ><body> > ><?php if (!isset($name) ): ?> > > <!-- No name has been provided, so we > prompt the user for one. --> > > <form action="<?=$PHP_SELF?>" method="get"> > Please enter your name: <input type="text" name="name" /> > <input type="submit" value="GO" /> > </form> > ><?php else: ?> > > <p>Your name: <?=$name?></p> > > <p>This paragraph contains a <a >href="newpage.php?name=<?=urlencode($name)?>">link</a> that passes the >name >variable on to the next document.</p> > ><?php endif; ?> > ></body> ></html> > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > = = = = = = = = = = = = = = = = = = = =         Meteorlet         meteorlet@sjtu.edu.cn           2004-02-16

« previous php.windows (#22825) next »