/    Sign up×
Community /Pin to ProfileBookmark

Password code does not work

[CODe]
<? include_once(“protect.php”); ?>

<form method=”post” action=”http://”> [COLOR=Red]//I putted my protected page here[/COLOR]
<table>
<tr><td><b class=rng>Username:</b></td><td> </td><td>
<input type=”text” name=”username” size=”20″></td></tr>
<tr><td><b class=rng>Password:</b></td><td> </td><td>
<input type=”password” name=”password” size=”20″></td></tr>
<tr><td colspan=”3″ align=”center”><input type=”submit” value=” Submit “></td></tr>
</table>
</form>

<?PHP

# Change the below lines to the results that makepass.php gave you
#
$user = ’20e5c3d492611b2c68f9ae86b744bd26′;
$pass = ‘2d07fad78478d88ebafdc581a91696bf’;
#
# Change the above lines to the results that makepass.php gave you

if(md5($_POST[‘username’]) == $user && md5($_POST[‘password’]) == $pass)
{
setcookie (“verified”, true);
header (“Location:[url]http://www.[/url]”); [COLOR=Red]//my main page right here[/COLOR]
}
else
{
echo (“Incorrect Password”);
}
?>

<?PHP

# Protect page from being called directly from web browser
$back = “<form><input type=’button’ value='< Back’ onclick=’history.back()’></form>”;
$acc_denied = “<h3>Access Denied</h3>”.$back; # you could add a link to where users can login here…
if (!isset($_COOKIE[“verified”])) { die($acc_denied); }

?>
[/CODE]

people could access through without knowing the account. Please help me, thanks

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@bokehDec 16.2005 — What's in [B]protect.php[/B]?
Copy linkTweet thisAlerts:
@xin3m1nuhonauthorDec 16.2005 — protected.htm, because when I change htm to php, and it looks like a file, doesn't look like a page to me
×

Success!

Help @xin3m1nuhon spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...