Page 1 of 1

Cookie Implementation

Posted: Wed May 19, 2004 9:25 am
by aking1987
How can i implement a cookie to by-pass the login for this script... (im a right beginner so detailed explanation wud b helpful)

Code: Select all

<html>

<head>
<title>password protection test</title>
</head>

<body>
<?php

// Define your username and password
$username = "user";
$password = "password";

if ($_POST&#1111;'txtUsername'] != $username || $_POST&#1111;'txtPassword'] != $password) &#123;

?>
<p>
<b>Login</b>
</p>
<form name="form" method="post" action="<?php echo $_SERVER&#1111;'PHP_SELF']; ?>">
<div align="center">
<center>
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<td><label for="txtUsername">Username</label>
</td>
<td><input type="text" title="Enter your Username" name="txtUsername" /></td>
</tr>
<tr>
<td><label for="txtpassword">Password</label>
</td>
<td><input type="password" title="Enter your password" name="txtPassword" /></td>
</tr>
</table>
</center>
</div>
<p align="center"><input type="submit" name="Submit" value="Login" /></p>
</form>

<?php
&#125;
else &#123;
?>

<p>This is the protected page. Place your content here.</p>

<?php
&#125;
?> 

</body>

</html>

Posted: Wed May 19, 2004 9:32 am
by patrikG
Maybe this thread is helpful to you: viewtopic.php?t=11417

Posted: Wed May 19, 2004 10:37 am
by aking1987
im sorry... i have no idea how to do this

i have practically ne experience with stuff like this

:?: :?:

Posted: Wed May 19, 2004 10:42 am
by patrikG