does this code make sense?
Posted: Mon Aug 16, 2004 6:16 pm
Hi,
I basically have a page where users log in. And I would just like to know if how I did it is ok, or is there a flaw.
this is in my head
and this is in my body
I basically have a page where users log in. And I would just like to know if how I did it is ok, or is there a flaw.
this is in my head
Code: Select all
<?php ob_start();
session_start();
$username = $_POST['username'];
$_SESSION['username'] = $username;
?>
<?php require_once('Connections/marketbr.php'); ?>
<?php
//encrypte the password when user logs in to match the one in the database
$md5 = md5(md5($password));
mysql_select_db($database_marketbr, $marketbr);
$query_Login = "SELECT * FROM signup WHERE username = '$username' AND password = '$md5'";
$Login = mysql_query($query_Login, $marketbr) or die(mysql_error());
$row_Login = mysql_fetch_assoc($Login);
$totalRows_Login = mysql_num_rows($Login);
?>Code: Select all
<?php if ($totalRows_Login >= 1) {
print 'show restricted information';
}else {
header ('Location: error.php?login=No Login');
}
?>