View Single Post
Old 01-19-2003, 07:29 AM   #7 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
I still cant qite figure it out:

here is my code for main.php
PHP Code:
<?
include("connect.php");
session_start();
session_register("username");
session_register("password");

$password=$_GET['password'];
$username=$_GET['username'];

$result=mysql_query("select * from users where username='$username' and password='$password'");

$num=mysql_num_rows($result);

if(
$num 1){
  
header("location: failed2.php");
}

?>
Now that part works fine. Just when I load the page profile.php which right now just simply lists username, email etc, i get the failed2.php.

my code for that part is:
PHP Code:
<?
include("connect.php");
session_start();

$result=mysql_query("select * from users where username='$username' and password='$password'");

$num=mysql_num_rows($result);

if(
$num 1){
  
header("location: failed2.php");
}
?>
so the username and password should be registered so I can open them from any page right? what am I forgeting?

thanks,

Trevor
trevor is offline   Reply With Quote