[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:

<?php
	$PAGE2GO2 = $_GET["page"];
	header("Location: $PAGE2GO2");
?>


here is the HTML:

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

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

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

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

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

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

</select>

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

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>

<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.
</tip>

Thanks Evolters!

TjL

--
30 Days to becoming an Opera Lover
                                  http://www.tntluoma.com/opera/lover/
Day 20: Stylin'
                         http://tntluoma.com/opera/lover/day20-stylin/





More information about the thelist mailing list