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