Hello, So I try to use header( "Location:" .$row['url'] ); in order to redirect to a url saved in my database however all I get is a blank page. Any ideas? <?php include("config.php"); session_start(); if($_SERVER["REQUEST_METHOD"] == "POST") { // username and password sent from form $myusername=addslashes($_POST['username']); $mypassword=addslashes($_POST['password']); $mypassword=md5($mypassword); $sql="SELECT id FROM users WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); $row=mysql_fetch_array($result); $active=$row['active']; $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1) { session_register("myusername"); $_SESSION['login_user']=$myusername; header( "Location:" .$row['url'] ); exit; } else { $error="Your Login Name or Password is invalid"; } } ?> Code (markup):
It's maybe sql excute but return nothing. So before redirect you try to print out (echo command) $row['url']. You will have your own way to go. That's all.
The blank page is the same as the initial one which in this case is login.php. The sql query is returning the correct values, however the redirect does not happen for some reason