Jump to content

[SOLVED] Simple Login


TheJoey

Recommended Posts

hey im trying to create a simple login where the username and admin are fixed and i was hopeing to do it similar to this

<?php 
session_start(); 
$name = $_POST['username'];
$pass = $_POST['password'];
if $name = 'admin' && $pass = 'admin'
{
$_SESSION['success'] = true;  	  
   header("location: success.php");  
} else {								  
  header("location: nsuccess.php"); 
}
?>

 

cant seem to get this to work.

 

Link to comment
https://forums.phpfreaks.com/topic/174967-solved-simple-login/
Share on other sites

needs to be enclosed

 

<?php 
session_start(); 
$name = $_POST['username'];
$pass = $_POST['password'];
if ($name = 'admin' && $pass = 'admin')
{
$_SESSION['success'] = true;       
   header("location: success.php");  
} else {                          
  header("location: nsuccess.php"); 
}
?>

Link to comment
https://forums.phpfreaks.com/topic/174967-solved-simple-login/#findComment-922134
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.