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 Link to comment https://forums.phpfreaks.com/topic/112290-how-do-i-make-loginsgn-up-script/ 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.. Link to comment https://forums.phpfreaks.com/topic/112290-how-do-i-make-loginsgn-up-script/#findComment-576570 Share on other sites More sharing options...
Russellwoot Posted June 28, 2008 Author Share Posted June 28, 2008 thanks Link to comment https://forums.phpfreaks.com/topic/112290-how-do-i-make-loginsgn-up-script/#findComment-576740 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.