Hi
as a complete novice I'm trying to get my head around security in php and mysql
I know how to set up users in mysql but I've just taken over a site which uses php and mysql and the following code gives access to the mysql database but the password and username listed is not shown as a user in mysql.
Is it that the session is not started unless the username entered matches that of the entries in 4?
thanks
Ian
<?php
session_start();
$user = $_REQUEST["username"];
$pass = $_REQUEST["password"];
if ($user == 'admin' && $pass =='password') {
$_SESSION['loggedin'] = TRUE;
header( 'Location: index.php' ) ;
} elseif ($user == 'marketing' && $pass =='puxton123') {
$_SESSION['loggedin'] = TRUE;
header( 'Location: index.php' ) ;
} else {
?>
as a complete novice I'm trying to get my head around security in php and mysql
I know how to set up users in mysql but I've just taken over a site which uses php and mysql and the following code gives access to the mysql database but the password and username listed is not shown as a user in mysql.
Is it that the session is not started unless the username entered matches that of the entries in 4?
thanks
Ian
<?php
session_start();
$user = $_REQUEST["username"];
$pass = $_REQUEST["password"];
if ($user == 'admin' && $pass =='password') {
$_SESSION['loggedin'] = TRUE;
header( 'Location: index.php' ) ;
} elseif ($user == 'marketing' && $pass =='puxton123') {
$_SESSION['loggedin'] = TRUE;
header( 'Location: index.php' ) ;
} else {
?>