Re: [PHP] Header (location: test.php);
Christopher Allen wrote: Hello, I am using the Header call in a script that has multiple submit buttons: if ($submit =1) { Header (location: test1.php); } if ($submit ==2) { Header(location: test2.php); } Should not the form varaibles be passed along to each of these pages respectively? I have about 30 variables that should be passed to each different page...none of these variables are showing up. Do I need to attach these to the url for each different header? such as: Header ("Location: test1.php?add=1name=juan"); ??? Thanks Christopher C. M. Allen yes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Header (location: test.php);
The answer is yes, you need to pass along your form variables. You could do this with the following: ?php $formVars = ""; //Use $HTTP_GET_VARS if form is a get type while(list($name,$value)=each($HTTP_POST_VARS)) { $formVars .= $name . "=" . $value . ""; } if($submit == 2) Header("Location: test2.php?" . $formVars); ? Hope that helps you out some. Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here if ($submit ==2) { Header(location: test2.php); } Should not the form varaibles be passed along to each of these pages respectively? I have about 30 variables that should be passed to each different page...none of these variables are showing up. Do I need to attach these to the url for each different header? such as: Header ("Location: test1.php?add=1name=juan");