Re: Re: header('Location:') works locally but not remotely

From: Date: Mon, 16 Apr 2007 18:18:25 +0000
Subject: Re: Re: header('Location:') works locally but not remotely
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-253045@lists.php.net to get a copy of this message
On Apr 16, 2007, at 12:44 PM, Ross wrote:
ok I have a page that calls my my functions, basically a 6 step signup. All the steps look like this function step_one() { $_SESSION['property_id'] =$_POST['property_id']; $property_id = $_POST['property_id']; $postcode= $_POST['postcode'];
Escape your data: $property_id = mysql_real_escape_string($_POST['property_id']); $postcode = mysql_real_escape_string($_POST['postcode']);
$query = "INSERT INTO properties (property_id, postcode) VALUES ('$property_id', '$postcode')"; $result= mysql_query($query); header( 'Location: ?step=two' );
As others have mentioned, you must include at least the relative path. header ("Location: add_new.php?step=two"); exit; Always include 'exit;' after a redirect. Happy coding... ~Philip
} This SHOULD redirect to add_new.php?step=two As add_new is the container page. Thanks. R.


« previous php.general (#253045) next »