Russellwoot Posted June 28, 2008 Share Posted June 28, 2008 can anyone teach me or give me a link to how to make a succsefful/ really easy and simple login script just so i get an idea on how to do it for my new website. and how do u include a php script in your website is it? <?php include ('blahblahvlag.php'); ?> is that how u do it cause its not working for me Quote Link to comment Share on other sites More sharing options...
Natefons Posted June 28, 2008 Share Posted June 28, 2008 you would need to initialize session_start(); then make a form for the name one <form action="/process/login.php" method="post" name="login"> </p><br /> UN: <input name="username" class="textbox" type="text" size="15" /> </p> PW: <input name="password" class="textbox" type="text" size="15" /> now you will need a file in process/login.php login.php: $user=mysql_real_escape_string($_POST['username']); $pass=mysql_real_escape_string($_POST['password']); $query=mysql_query("select * from `users` where `login`='".$pass."' and `user`='".$user. "';") or die(mysql_error()); if(mysql_num_rows($query)>0) { while($row=mysql_fetch_assoc($query)) { $_SESSION['login']= true; $_SESSION['userid']=$row['user']; $_SESSION['rank']=$row['rank']; } this is how eric rosebrock taught me.. Quote Link to comment Share on other sites More sharing options...
Russellwoot Posted June 28, 2008 Author Share Posted June 28, 2008 thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.