note 39190 deleted from control-structures by didou

From: Date: Tue, 20 Jan 2004 10:25:16 +0000
Subject: note 39190 deleted from control-structures by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-63864@lists.php.net to get a copy of this message
Note Submitter: admin@tenriats.com ---- Yeah, it's also great to use if statements when you're using the POST method in a form and you have required fields. Here's an example. <form action=login.php method=POST>Email: <input type=text name=email><br>Password: <input type=password name=pass><br><br><input type=submit value=Login!> Now we make sure our required fields have been filled. <?php session_start(); if (!$email) { print "You didn't enter your email into the form! Please go back and do so."; exit; } elseif (!$pass) { print "You didn't enter a password! Please go back and do so."; } else { session_register($email); session_register($pass); } ?>

« previous php.notes (#63864) next »