zeeshan Posted March 11, 2008 Share Posted March 11, 2008 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 More sharing options...
justsomeguy Posted March 11, 2008 Share Posted March 11, 2008 setcookie(ID_my_site, $_POST['username'], $hour);setcookie(Key_my_site, $_POST['pass'], $hour);That is how you set a cookie. You will need to quote those names though if they aren't defined as constants (they might be).http://www.php.net/manual/en/function.setcookie.php Link to comment Share on other sites More sharing options...
zeeshan Posted March 11, 2008 Author Share Posted March 11, 2008 hi friends can u tell me few place where i should go to learn php Link to comment Share on other sites More sharing options...
justsomeguy Posted March 11, 2008 Share Posted March 11, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.