How do I get this to work, Please Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • doharr
    New Member
    • Feb 2008
    • 3

    How do I get this to work, Please Help

    I have a simple frame set up. With a header box containing the logo, and two columns underneath, the working part.
    In the left side there is a form box to enter request into.
    The request will be names of colors like; red, purple, yellow, blue and others.
    Once the name of the color is entered into the box, and enter is hit, the desired color is shown in the 2nd column.

    The entered word will need to be combined into a URL statement like this.
    http://www.server.com/%REPLACETHIS%.h tml

    With %REPLACETHIS% being replace by the entry word from the client.

    The files stating colors are single files and are located on the server.
    http://www.server.com/red.html
    http://www.server.com/purple.html
    http://www.server.com/yellow.html
    http://www.server.com/blue.html

    I don't want to set up a CGI-BIN search or Google search added to the site.

    Thank you for any help!

    Also posted in:
    Community > Developer Groups > HTML / CSS > HTML / CSS Forum
  • jenkinsloveschicken
    New Member
    • Dec 2006
    • 56

    #2
    doharr,

    Not sure what scripting mix you are building on, but I would say just submit your form data to a single script(which will be your right-hand frame source) and process the $_POST variable for color and display the page data accordingly.

    For example:

    Code:
    if (isset($_POST['color'])) {
    
           $color = $_POST['color'];
    
           switch ($color) {
                 case "red":
                      echo "such and such";
                 break;
                 case "blue":
                      echo "such and such";
                 break;
            }
    }else{
    //your error catch here
    }
    Another way to do it would be submitting to a parse script that takes the $_POST value and creates the url, then sends the user through a meta-refresh to the newly formed url.

    Hope this helps. Post back if you need more assistance.


    Regards,
    Jenkins
    Last edited by jenkinsloveschicken; Feb 4 '08, 06:50 PM. Reason: Addition

    Comment

    Working...