View Full Version : Drop Down List to Page Question

03-17-2009, 06:11 PM
Hey Guys,

I have a form set up on one of my pages that I intend to use to have users select their "State" and then forward them to a page based on their selection.

Before I go through the effort of inputting all the values I'm trying to make sure I can get the transfer PHP code to work right.

I followed the tutorial on about.com regarding this and my form is currently:

<form name="ex2" action="xfer.php" method="POST"><div align="center">
<select name="xfer" size="1">
<option value="index.html">Browsers</option>
<option value="test2.html">HTML</option>
<option value="test3.html">Javascript</option>
<input type="submit" value="Go!" />

The variable xfer should contain the selections web-address value.

As instructed in the tutorial I created a php page with the following code.

$xfer = $_POST['xfer'];
header("location: $xfer");

All the code does right now is forward the user to xfer.php and it doesn't do anything except load a blank screen. I imagine I'm probably missing some big php script that I'm suppose to have already.

Thanks in advance for any help. I'm a complete php newb.

03-17-2009, 06:18 PM
Just figured it out! - Resolved.