#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    MO, US
    Posts
    119
    Rep Power
    15
    If I had a form that had multiple variables - for example:

    I had many cities to choose from and when they chose the city it showed zip codes in that city and then the user clicks their zip code and it shows them what they previously chose at the top of the next web page. If it was correct, they would click 'next' and could enter information in. When they're finished and they submit, how do i get back what they chose from every page through e-mail notification? or, would it be stored on my server? Please help!

    I have a FreeBSD server, full access rights to my site and the sites i host.

    Thanks!

    Ken
  2. #2
  3. Full Access
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jun 2000
    Location
    London, UK
    Posts
    2,019
    Rep Power
    17
    From what you've said in your previous post, you want to select a city from one menu, then the values in another menu change to reflect the city in the first one. I've never done anything like this before, but it is possible: there's a kewl example at http://www.carphonewarehouse.com/nav/index.asp?maj=1&min=1&hr=/packageb uilder/phones/makemod_frames.asp

    If you take the time to figure out how it works then you have the solution to your first problem.

    If you want something emailed to you, such as the variables they choose, then you have to have your form posted to a PHP program or such that will email the results to you. Like this:

    <?

    mail("you@you.com",
    "Information from form",
    "Someone chose $city and $postcode");

    ?>

    The first thing in inverted commas is your email address, the second is the subject, and the third is the body of the email. In your form you would call the city drop-down menu city and the postcode one postcode, and then you would post the form to this PHP program, say we call it email.php3 then your form header would look like:

    <form method=POST action=email.php3>

    If you want to have it stored on your server then the best way is with mySQL. If you want it both emailed to you AND stored on the server this is again possible: I suggest you read the "Beginning mySQL tutorial" at http://www.devshed.com/Server_Side/MySQL/Intro/

    If you want to have what they selected shown at the top of the next page, then you just make a .PHP file which the form in the previous page gets posted to. Like this:

    <html>
    <head>
    <title>Form results</title>
    </head>

    <body>

    <form method=POST action=email.php3>

    <input type=hidden name=city value="<? $city ?>">

    <input type=hidden name=postcode value="<? $postcode ?>">

    On the previous page, you chose <b><? $city ?></b> for your city and <b><? $postcode ?></b> for your postcode. If this information is correct please click Submit

    <input type=Submit value=Submit>

    </form>

    </body></html>

    Note that you HAVE to save this with the extension .php3 because you have PHP commands in it.

    If there is anything here that you don't understand then my email address is alex.greg@hotbot.com and my ICQ number is 62878174 Just drop me a note

    Good luck!

    -------------------------------
    Alex Greg
    (http://www.alex-greg.co.uk)

    [This message has been edited by alexgreg (edited June 19, 2000).]

Similar Threads

  1. Storing data /file locally from client
    By Zitan in forum PHP Development
    Replies: 5
    Last Post: November 14th, 2002, 09:51 PM

IMN logo majestic logo threadwatch logo seochat tools logo