XxDxX
07-16-2004, 12:39 PM
In php5 is there still the else statment? Cause I am reading the book php5 and mysql for dummies, and it doesn't have anything in there about the else statment.
|
Click to See Complete Forum and Search --> : statments question XxDxX 07-16-2004, 12:39 PM In php5 is there still the else statment? Cause I am reading the book php5 and mysql for dummies, and it doesn't have anything in there about the else statment. goldbug 07-16-2004, 01:12 PM Have you tried using it yet? XxDxX 07-16-2004, 01:18 PM I have tried, but I keep getting errors, I don't know if I am putting it in right. goldbug 07-16-2004, 01:31 PM what does your code look like? XxDxX 07-16-2004, 01:42 PM <? if ($username==Dylan) { hello you may contniue } else { sorry please go back } <form action="password.php" method="POST"> <input type=text name="username" value="enter" ?> XxDxX 07-16-2004, 01:43 PM Originally posted by XxDxX <? if ($username==Dylan) { hello you may contniue } else { sorry please go back } <form action="password.php" method="POST"> <input type=text name="username" value="enter" ?> I am trying to make a login script. goldbug 07-16-2004, 02:22 PM well, if that is literally your exact script... try wrapping your raw strings in quotes, and use echo, like so (you've also got your ?> in the wrong place): <?php if ($username=="Dylan") { echo "hello you may contniue"; } else { echo "sorry please go back"; } ?> <form action="password.php" method="POST"> <input type="text" name="username" value="enter"> ... PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved. |