[SOLVED] isset() in if statement problems
Posted: Tue May 27, 2008 5:22 am
Guys,
Can someone please explain to me how isset works in a if statement?? I've read numerous posts on the Internet and read the PHP Manual and thought that I did grasp it but this piece of code does not want to play nice... (Please draw pictures because I'm going to pretend to be slow - oh I forgot don't have to pretend -)
My Form:
My PHP Query:
The strange thing is that I have written a LOgin Page with similar code and that works and I have gone over the code several times but I can't find the problem and unfortunately there is no-one here, where I work, that can help me.
Can someone please help me?
Can someone please explain to me how isset works in a if statement?? I've read numerous posts on the Internet and read the PHP Manual and thought that I did grasp it but this piece of code does not want to play nice... (Please draw pictures because I'm going to pretend to be slow - oh I forgot don't have to pretend -)
My Form:
Code: Select all
<form method="post">
<tr><td>Full Name:</td><td><input type="text" size="15" maxlength="40" name="fname"></td></tr>
<tr><td>User Name:</td><td><input type="text" size="15" maxlength="40" name="uname"></td></tr>
<tr><td>Password :</td><td><input type="password" size="15" maxlength="40" name="passwd"></td></tr>
<tr><td><input type="submit" value="Create" name="submit"><input type="reset" value="Clear"></td></tr>
</form>Code: Select all
<?php
if (isset($_POST['fname']) && isset($_POST['uname']) && isset($_POST['passwd'])) {
$fname = $_POST['fname'];
$uname = $_POST['uname'];
$passwd = $_POST['passwd'];
} else {
echo "<center><font=\"red\">Not All Fields Filled IN!!</font></center>";
exit();
}
echo "<center><font color=\"red\">". $fname ."</font></center>";
echo $uname;
echo $passwd;
?>Can someone please help me?