rafique12
asked on
ERROR MESSAGE OVERLOAD
I am getting 5 seperate error messages when I execute my login page in Internet explorer. I am completly flumuxed by this. I've attached the code as well as all 5 error messages. Sorry for making so much work!
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Inetpub\wwwroot\strictl y-invite.c o.uk\stric tlyinvite files\html\website\login.p hp:4) in C:\Inetpub\wwwroot\strictl y-invite.c o.uk\stric tlyinvite files\html\website\login.p hp on line 13
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Inetpub\wwwroot\strictl y-invite.c o.uk\stric tlyinvite files\html\website\login.p hp:4) in C:\Inetpub\wwwroot\strictl y-invite.c o.uk\stric tlyinvite files\html\website\login.p hp on line 13
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Inetpub\wwwroot\strictl y-invite.c o.uk\stric tlyinvite files\html\website\login.p hp on line 22
Warning: include(loginhtml) [function.include]: failed to open stream: No such file or directory in C:\Inetpub\wwwroot\strictl y-invite.c o.uk\stric tlyinvite files\html\website\login.p hp on line 24
Warning: include() [function.include]: Failed opening 'loginhtml' for inclusion (include_path='.;C:\php5\p ear') in C:\Inetpub\wwwroot\strictl y-invite.c o.uk\stric tlyinvite files\html\website\login.p hp on line 24
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Inetpub\wwwroot\strictl
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Inetpub\wwwroot\strictl
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Inetpub\wwwroot\strictl
Warning: include(loginhtml) [function.include]: failed to open stream: No such file or directory in C:\Inetpub\wwwroot\strictl
Warning: include() [function.include]: Failed opening 'loginhtml' for inclusion (include_path='.;C:\php5\p
<?php
$dbhost = "localhost";
$dbname = "users";
$dbuser = "root";
$dbpass = "pass";
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
session_start();
$username = $_POST[username];
$password = md5($_POST[password]);
$query = "SELECT * FROM users where username= $'username' and password= $'password'";
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = 'Bad Login';
include login.html;
} else {
$_SESSION[username] = '$username';
include welcome.php;
}
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That seems to have worked. Thanks guys!
* Misplaced quote errors
* Concatenation errors
Hope this revision helps you out.
Open in new window