Guest_imported
New member
- Jan 1, 1970
- 0
Hi I've been working on a script and I've done all the sign up pages and stuff but I don't know how to do it so the user can login and view there information. What I need todo is just have a basic login for the different users and I want to make sure that the pages are secure.
The user records are stored in the users_tbl and the login form has the text boxes login [the username] & pass [the password] and the page they redirect to is team.php
So far I've come up with the following but it doesn't work. I'd be greatful if you could show me what is wrong and please could you show me how I can make the team.php secure. Thanx
<?
require("config.inc.php"
;
$db = mysql_connect($host,$login,$pass);
mysql_select_db($base,$db);
$sql = "select pass from users_tbl where login='$login'";
$req = mysql_query($sql) or die('SQL Error !<br>'.$sql.'<br>'.mysql_error());
$data = mysql_fetch_array($req);
if($data['pass'] = $pass)
{
session_start();
session_register('login');
header('LOCATION: team.php');
}
else
{
echo '<p>Wrong name/pass. Try again</p>';
include('login.php');
exit;
}
?>
The user records are stored in the users_tbl and the login form has the text boxes login [the username] & pass [the password] and the page they redirect to is team.php
So far I've come up with the following but it doesn't work. I'd be greatful if you could show me what is wrong and please could you show me how I can make the team.php secure. Thanx
<?
require("config.inc.php"
$db = mysql_connect($host,$login,$pass);
mysql_select_db($base,$db);
$sql = "select pass from users_tbl where login='$login'";
$req = mysql_query($sql) or die('SQL Error !<br>'.$sql.'<br>'.mysql_error());
$data = mysql_fetch_array($req);
if($data['pass'] = $pass)
{
session_start();
session_register('login');
header('LOCATION: team.php');
}
else
{
echo '<p>Wrong name/pass. Try again</p>';
include('login.php');
exit;
}
?>