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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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