shirvo Posted November 7, 2006 Share Posted November 7, 2006 This is really simple i'm sure but i dont know how to do it.this is the code. once it has logged in the user i want it to move to a different page automaticly and have querystings attached to it. below i will mark where i want the code to go.<html><head><title>Login</title></head><body><center><table><form method=post action=login.php> <p>Enter username and password to login</p><p>User Name <input type=text name=user_name></p><p>Password <input type=password name=password></p><center><input type=submit value="Login"> </center></form><?include 'connect.php';$user_name = $_POST['user_name']; $password = $_POST['password']; if ($user_name == "" or $password == "");else{$sql_query = mysql_query("SELECT password FROM user_data WHERE user_name='$user_name'",$db); $rs = mysql_fetch_row($sql_query); if($password != $rs[0]) echo "ERROR: Invalid User"; else[color=red]echo "You are logged in";[/color]}?></table></body></html> Link to comment https://forums.phpfreaks.com/topic/26432-move-to-next-page/ Share on other sites More sharing options...
Gruzin Posted November 7, 2006 Share Posted November 7, 2006 Instead of echo, just use header function to redirect the user:[code]<?phpheader ('Location: logged_in.php');?>[/code] Link to comment https://forums.phpfreaks.com/topic/26432-move-to-next-page/#findComment-120870 Share on other sites More sharing options...
shirvo Posted November 7, 2006 Author Share Posted November 7, 2006 Hi but that didn't work it just refreshed the login page. I changed the page to a real one first as well lol. Link to comment https://forums.phpfreaks.com/topic/26432-move-to-next-page/#findComment-121278 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.