note 55349 rejected from language.operators.logical by betz

From: Date: Sun, 31 Jul 2005 21:02:05 +0000
Subject: note 55349 rejected from language.operators.logical by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-92843@lists.php.net to get a copy of this message
Note Submitter: johnny dot ensign at gmail dot com ---- I am just beginning to learn some PHP, and I have a few questions about Operators. I am trying to create a mail script that alerts the users if a text box was empty... I decided to use the empty(); function, but there is 4 text boxes. The logical operator || works only for 2 texts. here is a sample script...: <?php if (empty($fname)) || (empty($lname))) { print "<script language=\"javascript\"> alert(\"One of the name fields is empty. Please fill those in and re-submit the form\"); history.go(-1); </script>"; } ?> I thought about using elseif(); but that didn't work. Because then I could use 2 more... if(anyone can help me) { mail(johnny.ensign@gmail.com) } lol There is alot more but that is all that I wanted to write at the moment. my email is johnny.ensign@gmail.com I am 14 yrs old, and I am trying to get good at PHP... Thanks - Johnny

« previous php.notes (#92843) next »