Jump to content

[SOLVED] login script error


HoTDaWg

Recommended Posts

its strange, its either when you hit submit the header location goes to Yahoo! or it says access denied. here is my script:
[code]
<?php
$submittedusername = $_REQUEST['submittedusername'];
$submittedpassword = $_REQUEST['submittedpassword'];

$username[0] = "user1";
$username[1] = "user2";
$password="pass";

if ($submittedusername=='$username'  &&  $submittedpassword=='$password'){
header("Location:http://www.yahoo.ca/");
} else {
echo "Access Denied";
}

?>
[/code]
and the html part is:
[code]
<html>
<head>
<title>Log-in</title>
<head>
</head>
<body>
<form name="login" action="login.php">
username: <input name="submittedusername" type="text" /><br />
password: <input name="submittedpassword" type="text" /><br />
<input type="submit" value="Submit!" />
</form>
</body>
</html>
[/code]
where have i gone wrong?
any help would greatly be appreciated. thanks.

HoTDaWg
Link to comment
https://forums.phpfreaks.com/topic/32134-solved-login-script-error/
Share on other sites

thanks a lot guys. but i changed the login.php script to:
[code]
<?php
$submittedusername= $_REQUEST['submittedusername'];
$submittedpassword= $_REQUEST['submittedpassword'];

$username= "xxxxx"
$password="xxxxxxxx";

if ($submittedusername==$username  &&  $submittedpassword==$password){
header("Location:http://www.yahoo.com/");
} else {
echo "Access Denied";
}

?>
[/code]
but i still get this error:
[code]
Parse error: syntax error, unexpected T_VARIABLE in /home/mediacir/public_html/djscript/login.php on line 6
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.