Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Mar 2009
    Posts
    108
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Drop Down List to Page Question

    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:

    Code:
    <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.

    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.

  • #2
    Regular Coder
    Join Date
    Mar 2009
    Posts
    108
    Thanks
    13
    Thanked 0 Times in 0 Posts
    Just figured it out! - Resolved.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •