Jump to content

how do i make login/sgn up script


Russellwoot

Recommended Posts

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

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..

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.