Unstoppable Domains โ€” AI Assistant

Login form

Spaceship Spaceship
Watch
Impact
0
please tell me how can I make a login form checking the username and password from a sql database.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
PHP:
if ($_POST['submit']) 
{ 

$db_host = "localhost";
$db_username = "xxxx";
$db_password = "xxxx";
$database = "xxxx";


mysql_connect(localhost,$db_username,$db_password);
@mysql_select_db($database) or die( "Unable to select database");


$passwordbeforemd5 = $_POST['password'];

$username = $_POST['username'];
$password = md5($passwordbeforemd5);


//Check user exists in database
$sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' LIMIT 1");

$login_check = mysql_num_rows($sql);

if ($login_check == "1") {
$_SESSION['logged_in'] = true;
include ("xxxx.php");
                                }
else {
echo "we could not log you in";
      }
}

Something like that should do it. Just replace the xxxx's with whatever is necessary.
 
0
•••
Appraise.net
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back