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 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    form help please

    Hello, I hope someone can help point me in the right direction.
    I am building a multi page form. The first page has three options(below). What I need is for the user, upon clicking the "Next Page" button be directed to either a supportscsi.php page, supportfibre.php page or a supportiscsi.php page, depending on what technology option they have chosen. I am unclear on what PHP code to put in the beginning of the form for form metod and post, the three options and the "Next Page" name section.
    <FORM METHOD=POST ACTION="/techsupt2.php" NAME="register">

    <select name="Technology">
    <option value>-----Please select-----</option>
    <option value="Fibre">Fibre Channel</option>
    <option value="SCSI">SCSI</option>
    <option value="iSCSI">iSCSI</option>

    </select>

    <input type="submit" value="Next Page" name="" />

    I appreciate any help. Thank you in advance.

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Location
    Preston, Lancashire, England
    Posts
    285
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i would do this.
    PHP Code:
    <?
      $pagename 
    $_POST["Technology"];
    switch(
    $pagename)
    {
    case  
    "Fibre"$pagename "supportfibre.php"; break;
    case  
    "SCSI"$pagename "supportscsi.php"; break;
    case  
    "iSCSI"$pagename "supportiscsi.php"; break;
    default; print 
    "PAGE NO FOUND";
    }

    header ("location:  $pagename"); 
    ?>
    Reason i have put it in a switch statement and not just done this
    PHP Code:

    $page 
    "support".$_POST["Technology"] .".php"
    is that it makes sure they can only go to those three pages.
    i.e. if you have a page called supportbras.php or supportthekippers.php
    people could make the form go to those two.
    Last edited by MRMAN; 06-14-2006 at 04:54 PM.

  • #3
    New Coder
    Join Date
    Apr 2004
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thank you, MRMAN

    Thanks. I tried your code and when I try to open the form in Dreamweaver, it is redirected to the homepage to our site...
    Any ideas?

  • #4
    New Coder
    Join Date
    Apr 2004
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    not sure of how to start and end form

    Here is what I have for the beginning of the form:

    <FORM METHOD=POST ACTION="" NAME="register">

    here is what I have for the submit to the next page at the bottom of the form:

    <input type="submit" value="Next Page" name="Technology" />

    I appreciate your time/help


  •  

    Posting Permissions

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