Not sure what exactly is happening, would this work?Code:header("Location: http://www.msforums.org");
HI, Guys!
I have a problem of using PHP to develop a user login for the restricted webpages of my website....
I need your help! :unsure:
Could you tell me what's wrong with the coding?[the BOld & highlighted line below]
Thank you very much!<html>
<head>
<title>Jason's Photo Album</title>
</head>
<body bgcolor="white" text="black" link="black" vlink="#666666" alink="#999999" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
<p align="center"><font face="Arial">
<?php
$user = "Ducky"; #This is the username you login with
$password = "yogatogapi"; #This is the password you login with
if($_POST["name"]==$user) {
if($_POST["pass"]==$password) {
? #If username and password is correct
? <meta http-equiv="refresh"? content="0;URL=http://wwww.something.com/JasonsPhotoAlbum.html">
?*
}else{
? #If username is correct but password isn't
? echo "The password you entered was invalid!";
}
}else{
if($_POST["pass"]==$password) {
? #The username was wrong but the password wasn't
? echo "The username you provided was invalid!";
? }else{
? #The username and password were both wrong
? echo "The username and password you provided was invalid!";
}
}
?>
</font></p>
</body>
</html>
Not sure what exactly is happening, would this work?Code:header("Location: http://www.msforums.org");
It returns an RUNTIME ERROR when I proceed login!
Do you have any idea why this runtime error occured?Warning: Cannot modify header information - headers already sent by (output started at D:\--------\login.php:10) in D:\--------\login.php on line 18
Bookmarks