...

View Full Version : Drop Down List to Page Question



CSSQuest
03-17-2009, 05: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>
</select>
<input type="submit" value="Go!" />
</div></form>


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.

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum