Monday, March 24, 2014

PHP Cookie

<?php
$un=$_POST['username'];
setcookie('Login','$un');
?>
<html>
<center>
<h2>Please Login</h2>
<form method="POST">
<table>
<tr>
<td>
UserName:
</td>
<td>
<input type="text" name="username"?>
</td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password"/>
</tr>
<tr>
<td><input type="submit" value="Submit" name="submit"/></td>
</tr>
</table>
</form>
</center>
</html>

Save and run file. Enter info and submit it. Now open setting page of your browser and open cookies check there for our cookie.

No comments:

Post a Comment