note 55349 added to language.operators.logical

From: Date: Sun, 31 Jul 2005 20:53:52 +0000
Subject: note 55349 added to language.operators.logical
Groups: php.notes 
Request: Send a blank email to php-notes+get-92842@lists.php.net to get a copy of this message
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 ---- Submitter IP: 64.246.30.37 ---- Manual Page -- http://www.php.net/manual/en/language.operators.logical.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55349 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55349&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55349&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55349&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55349&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55349&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55349&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55349&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#92842) next »