<?php
if ($submit) :
$db=mysql_connect("localhost","xxxxxx","xxxxx") or die ("cant connect");
mysql_select_db("xxxxxx",$db) or die ("cant change");
$result=mysql_query("select * from joborder where user='$username'",$db) or die ("cant do it");
while ($row=mysql_fetch_array($result)) {
if ($row["pass"]==$password) {
printf("Successfully Logged In" .$row['fname']."!");
}
}
else:
?>
<form method=post action="<?echo $PHP_SELF?>">
<table cellpadding=2 cellspacing=0 border=0>
<td>Username:</td><td><input type="text" name="username" size=10></td><tr>
<td>Password:</td><td><input type="password" name="password" size=10></td><tr>
<td> </td><td><input type="submit" name="submit" value="Log In"></td>
</table></form>
<? endif; ?>
just an else sentence, you can write it as usual:
if condition {
....
}
else {
....
}
or the one used here (that i think i more clear when surrounding lot of code)
if ( ) :
.....
else:
.....
endif;