[thelist] having problems with php redirect form

Timothy J. Luoma lists at tntluoma.com
Fri Sep 20 14:55:01 CDT 2002

Oh good lord....

First, thanks for everyone who offered help.

Second, thanks to Rudy for mentioning METHOD.  Once I added that, I
found how to do what I needed to do, regardless of what is the default
(or what it is supposed to be).

Here is my PHP:

	$PAGE2GO2 = $_GET["page"];
	header("Location: $PAGE2GO2");

here is the HTML:

<form method="get" action="/redirect.php">

<select id="page" name="page">

<option value="" selected="selected">Jump To Day</option>

<option value="http://tntluoma.com/opera/lover/day01-why/">Day 1:

<option value="http://tntluoma.com/opera/lover/day02-install/">Day 2:

...{{and so on}}....


<input type="submit" value="go" />

Now before I put 'method="get"' into the FORM, I was not getting the
variable that I needed (namely "page")

<tip type="debugging PHP" author="Tim Luoma">
When debugging PHP, drop a 'phpinfo();' into your code so see what is
going on with variables, etc.  The presence or absence of information
may give clues to a solution.

<tip type="PHP and forms" author="Tim Luoma">
Always explicitly define the METHOD (either GET or POST) you want to use
in forms which will feed PHP as this will make sure some variables are
explicitly set.

Thanks Evolters!


30 Days to becoming an Opera Lover
Day 20: Stylin'

More information about the thelist mailing list