Jump to content

cookies


zeeshan

Recommended Posts

can u tell me how can i make a cookie for members is this login script has cookies..

else{// if login is ok then we add a cookie$_POST['username'] = stripslashes($_POST['username']);$hour = time() + 3600;setcookie(ID_my_site, $_POST['username'], $hour);setcookie(Key_my_site, $_POST['pass'], $hour);//then redirect them to the members areaheader("Location: members.php");}}}else{// if they are not logged in?><form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"><table border="0"><tr><td colspan=2><h1>Login</h1></td></tr><tr><td>Username:</td><td><input type="text" name="username" maxlength="40"></td></tr><tr><td>Password:</td><td><input type="password" name="pass" maxlength="50"></td></tr><tr><td colspan="2" align="right"><input type="submit" name="submit" value="Login"></td></tr></table></form><?php}?>

does this script make the cookies of its own

Link to comment
Share on other sites

Start with the manual at php.net. That will give you at least an introduction into what PHP is and what it does, read through the language reference there. You can try the PHP tutorial at w3schools but I don't think online tutorials are very effective for learning how to program, it might be better to get a book. The store at oreilly.com has several good books about PHP.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...