Ok, i am making a mail system so i can mail users, and i have the table all set up no errors as of yet.
But my question is how do i make an else statment 2 times.
So if there is mail it will show it, if no mail "No messages found"
and if there not logged in the { else } stament..
[PHP]<? if (logincheck($ui d, $upwd)) {
echo ("<p align=\"left\"> <br /><font color=\"#666666 \" size=\"1\" face=\"Arial\"> <a href=\"{$_SERVE R['PHP_SELF']}\">Check Mail</a></font> <fon t color=\"#666666 \" size=\"1\" face=\"Arial\"> |</font> <fon t color=\"#666666 \" size=\"1\" face=\"Arial\"> <a href=\"newmessa ge.php\">Send Message</a></font>
<hr size=\"1\" />");
$message_sql = "SELECT `title, message, date` FROM `usermail` WHERE `userid` = '".(int)$uid."' ";
$message_result = mysql_query($me ssage_sql ,$db);
$message_data = mysql_fetch_ass oc($message_res ult);
echo ("<table width=\"100%\" border=\"0\" cellspacing=\"0 \" cellpadding=\"0 \">
<tr><td><font color=\"#000000 \" size=\"1\"><b>< font color=\"#FF0000 \"> ".$message_ data["title"]." </font></b>");
echo ("<td><font color=\"#000000 \" size=\"1\"><b>< font color=\"#FF0000 \">" .$message_data["message"]." </font></b></td>");
echo ("</font></b><br /></td>
<td><font color=\"#000000 \" size=\"1\"><b>< font color=\"#FF0000 \"> ".$message_ data["date"]." </font></b></td></tr></table><br />");
echo ("<hr size=\"1\" />");
} else {
echo ("<p align=\"center\ "><br /><b>Error:</b> <font color=\"#FF0000 \">Guests Not Allowed!</font><br /><br />
Please login befor checking your mail<br />
<font face=\"Arial\" size=\"1\">---------------------------------------------------</font>
<br />
<a href=\"login.ph p\">Login</a> & nbsp; or&n bsp;   ; <a href=\"newuser. php\">Register</a><br />
<font face=\"Arial\" size=\"1\">----------------------------------------------------</font></p>");
}
?>[/PHP]
But my question is how do i make an else statment 2 times.
So if there is mail it will show it, if no mail "No messages found"
and if there not logged in the { else } stament..
[PHP]<? if (logincheck($ui d, $upwd)) {
echo ("<p align=\"left\"> <br /><font color=\"#666666 \" size=\"1\" face=\"Arial\"> <a href=\"{$_SERVE R['PHP_SELF']}\">Check Mail</a></font> <fon t color=\"#666666 \" size=\"1\" face=\"Arial\"> |</font> <fon t color=\"#666666 \" size=\"1\" face=\"Arial\"> <a href=\"newmessa ge.php\">Send Message</a></font>
<hr size=\"1\" />");
$message_sql = "SELECT `title, message, date` FROM `usermail` WHERE `userid` = '".(int)$uid."' ";
$message_result = mysql_query($me ssage_sql ,$db);
$message_data = mysql_fetch_ass oc($message_res ult);
echo ("<table width=\"100%\" border=\"0\" cellspacing=\"0 \" cellpadding=\"0 \">
<tr><td><font color=\"#000000 \" size=\"1\"><b>< font color=\"#FF0000 \"> ".$message_ data["title"]." </font></b>");
echo ("<td><font color=\"#000000 \" size=\"1\"><b>< font color=\"#FF0000 \">" .$message_data["message"]." </font></b></td>");
echo ("</font></b><br /></td>
<td><font color=\"#000000 \" size=\"1\"><b>< font color=\"#FF0000 \"> ".$message_ data["date"]." </font></b></td></tr></table><br />");
echo ("<hr size=\"1\" />");
} else {
echo ("<p align=\"center\ "><br /><b>Error:</b> <font color=\"#FF0000 \">Guests Not Allowed!</font><br /><br />
Please login befor checking your mail<br />
<font face=\"Arial\" size=\"1\">---------------------------------------------------</font>
<br />
<a href=\"login.ph p\">Login</a> & nbsp; or&n bsp;   ; <a href=\"newuser. php\">Register</a><br />
<font face=\"Arial\" size=\"1\">----------------------------------------------------</font></p>");
}
?>[/PHP]
Comment