[PHP] Problem with $_POST[] and header();
Hi, I have an include file which I use to check all input. if there is a problem the user is redirected to the page they came from if(!mysql_query($query)){ $error = Could not complete query; header(Location: file.php?error=$error); exit; } However in file.php I have included $_POST[] variables sent from a previous page using the following method foreach ($_POST as $key = $value) { echo input type=\hidden\ name=\.$key.\ value=\.$value.\; } But if there is a problem with the input the $_POST[] values are not resent, is there a way to do this? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with $_POST[] and header();
On Tue, 2 Dec 2003 10:26:08 -, you wrote: if(!mysql_query($query)){ $error = Could not complete query; header(Location: file.php?error=$error); exit; } The Location: header requires an absolute URI. See RFC 2616, 14.30 However in file.php I have included $_POST[] variables sent from a previous page using the following method foreach ($_POST as $key = $value) { echo input type=\hidden\ name=\.$key.\ value=\.$value.\; } But if there is a problem with the input the $_POST[] values are not resent, is there a way to do this? Pass them as part of a GET, or store them in a session (you may need to include the session ID as part of the URI). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with $_POST[] and header();
it works fine as it is though? David Otton [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Tue, 2 Dec 2003 10:26:08 -, you wrote: if(!mysql_query($query)){ $error = Could not complete query; header(Location: file.php?error=$error); exit; } The Location: header requires an absolute URI. See RFC 2616, 14.30 However in file.php I have included $_POST[] variables sent from a previous page using the following method foreach ($_POST as $key = $value) { echo input type=\hidden\ name=\.$key.\ value=\.$value.\; } But if there is a problem with the input the $_POST[] values are not resent, is there a way to do this? Pass them as part of a GET, or store them in a session (you may need to include the session ID as part of the URI). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php