Jump to content

PHP Can it do this?


kickassamd

Recommended Posts

Yes, easily. I would assume you were storing the usernames and passwords in a database.

 

<?php

$username = $_POST['username'];
$pass = $_POST['pass'];

$query = mysql_query("SELECT col1, col2, col3 FROM users WHERE username='$username' AND password = '$password'");

if (mysql_num_rows($query) < 1){
   echo "Wrong username/password combination";
} else {
   echo "Your username and password is correct!";
}

?>

Link to comment
https://forums.phpfreaks.com/topic/40624-php-can-it-do-this/#findComment-196487
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.