Jump to content

User Authentication


corillo181

Recommended Posts

i remember there was a tutorial in phpfreak tutorial section on building a membership system

i can't find this tutorial any log, but my question is.

how i make a User Authentication that was like the one they used?

 

i want to know is once i get the query how i do the rest?

if($_POST['Submit']){
$username=$_POST['username'];
$password=$_POST['password'];
if((!$username)||(!$password)){echo 'Please fill up all of the fields';}else{$get=mysql_query("SELECT * FROM tra_users WHERE username='$username' AND password='$password' AND activated='y'")or die(mysql_error());
$rows=mysql_num_rows($get);
$row=mysql_fetch_assoc($get);
if($rows>0){
$_SESSION['username']=$username;
$_SESSION['user_id']=$user_id;
header('Location:../home.php');
}else{ echo'not found';}
}
}else{}

 

the session part is wha ti dont ge thow to make it work..

Link to comment
https://forums.phpfreaks.com/topic/48882-user-authentication/
Share on other sites

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.