[UPHPU] Newbie needs help
David Boucha
boucha at gmail.com
Thu Jun 9 16:45:19 MDT 2005
>
> (samplepage.php from the book. Note: I added the
> first line because of the global variable change.)
> <?php
> $name = $_POST['name'];
> if (!isset($name)):
> ?>
> <!-- No name has been provided, so we
> prompt the user for one. -->
>
> <form action="<?=echo($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; ?>
>
> (the following is in the body of my html file. I
> believe this file works fine because I've used it in a
> previous example which did work.)
> <form action="samplepage.php" method="post">
> name: <input type="text" name ="name" /> <br />
> <input type="submit" value="go" />
> </form>
>
Another thing that might be causing you problems is that $PHP_SELF
doesn't seem to be available by itself anymore. I believe you have to
use $_SERVER["PHP_SELF"] or you can set $PHP_SELF =
$_SERVER["PHP_SELF"]
David Boucha
More information about the UPHPU
mailing list