note 48980 deleted from tutorial.forms by didou

From: Date: Fri, 14 Jan 2005 00:16:14 +0000
Subject: note 48980 deleted from tutorial.forms by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-83230@lists.php.net to get a copy of this message
Note Submitter: Sonte Reason: useless note ---- I just thought it was fun to use... <form action="hello.php" method="post"> <p>Your name: <input type="text" name="name" /></p> <p>Your age: <input type="text" name="age" /></p> <p><input type="submit" /></p> </form> <?php if ($_POST['name'] > " ") { ?> Hi <?php echo $_POST['name']; ?>. <?php } ?> <?php if ($_POST['age'] > 0) { ?> You are <?php echo $_POST['age']; ?> years old. <?php } ?> This makes the form post to itself (where hello.php = $yourpage) and only display output if 'name' contains something and/or 'age' is a positive number.

« previous php.notes (#83230) next »