You are here: Re: [PHP] how to exist within the context? « PHP « IT news, forums, messages
Re: [PHP] how to exist within the context?

Posted by Bing Du on 11/22/05 23:03

Ummm... but I don't see how that is related to my exit problem. Any
pointers for me to learn more about it? Thanks much for the help.

Bing

Jay Blanchard wrote:

> [snip]
> <form method=post>
> <input name="yourname" type="text" size="20">
> <input name="submit" type="submit" value="submit">
> </form>
>
> <?php
>
> $submit = $_POST['submit'];
> $name = $_POST['yourname'];
>
> if ($submit)
> {
> if ($name=="")
> {
> print "Please enter your name!";
> //exit;
> }
> }
>
> echo "Continue processing...";
> ?>
> [/snip]
>
> You have to POST the value back to the form. This is one of the harder
> concepts to grasp when programming in a stateless environment;
>
> <?php
> if(!isset($_POST['yourname'])){
> $theNameValue = 'Please enter your name';
> } else {
> $theNameValue = $_POST['yourname'];
> }
> ?>
>
> <form action="<?php echo $PHP_SELF; ?>"method=post>
> <input name="yourname" type="text" size="20" value="<?php echo
> $_POST['yourname']; ?>">
> <input name="submit" type="submit" value="submit">
> </form>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация