The following script is from Kevin Yank's book (Sitepoint).
When I test it _without_ entering a name in the text box and hit submit, the
_next_ page
loads - however the same page should load beacuse of the conditional
........
if (!isset($name) ):
.....
If I replace
!isset()
with
empty()
like
if (empty($name)):
and do not enter a name then the _same_ page loads which is what is supposed
to happen.
Why doesn't the call to !isset() with the negation mark loads the next page
when a name is not entered?
The script predates globals being turned off and it is below.
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