I tried. But I get an error as follows :
Warning: Cannot add header information - headers already sent by (output
started at /usr/local/www/virtual2/66/175/19/84/html/maintenance.php:11) in
/usr/local/www/virtual2/66/175/19/84/html/maintenance.php on line 30
My code is as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFCC">
<table width="70%" border="0">
<tr>
<td height="67" colspan="3" bgcolor="#330066">
<div align="center"><font color="#FFFF00" face="Arial, Helvetica,
sans-serif"><strong><font size="5">Site
maintenance page<?php
//connecting to the database
$link = mysql_connect("localhost","mydomain","somepass");
if ($link){
Print "";
} else {
Print "No connection to the database";
}
if (!mysql_select_db("mydomain_com")){
Print "Couldn't connect database";
} else {
Print ""."<br>\n";
}
$sql="SELECT AdminFirstName,AdminLoginId,AdminPassword FROM Administrators
where
AdminLoginId = '$AdminLoginId' and AdminPassword ='$AdminPassword'";
if ($result=mysql_query($sql)) {
$numofrows=mysql_num_rows($result);
if ($numofrows==0){
header("Location: http://www.php-faq.com/");
Print "<STRONG><font color=\"#FF0000\"size=\"3\">We are
sorry.</STRONG></FONT>";
}
if ($numofrows==1){
Print "<font size=\"3\" color=\#ff0000\">Welcome
".$AdminFirstName."<Font>";
}
if ($numofrows>1){
Print "<STRONG>Something wrong</STRONG>";
}
while($row=mysql_fetch_array($result)){
Print"<Font size=\"3\">$row[AdminFirstName]</font>";
}
}
?></font></strong></font></div></td>
</tr>
</table>
</body>
</html>
Unquote.
Line no. 30 is the one with the line : header("Location:
http://www.php-faq.com/");
Can you please tell me what is wrong?
thanks
denis