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 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jan 2010
    Posts
    101
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Help understanding forms, please?

    I've checked out a few free over-the-net forms services, and they work okay. They take my info and send it to my emails. But they're not really felixble enough to do what I want. I'm hoping that with a bit of understanding, I can get closer to what I want, vice restricting myself to a smaller framework.

    I'm going to have at least three different forms. First, the user would go to a "master" page, where I would collect basic information (Who Are You?), and from there the user would click a link to go to one of the other forms. I think this approach would be better than having them repeat all the "Who Are You" stuff on each form.

    I can validate the forms using JavaScript. I prefer doing it myself instead of using the form provider's built-in validation because there are some blocks that will or won't need to be filled out depepnding on other responses.

    Questions:
    -- How do I pass the intial information into each subsequent form?
    -- I think I know the forms are processed by a CGI script on the server. And most web site hosts have their own scripts, yes? And the information is sent to the CGI by code on my page linked to the Submit button. I would like a better understanding of what happens from the time I click Submit to the receiving of an email with the form info. (I figure if I have a better grasp of the processes, I can better understand what might be going wrong, or not do that in the first place.)

    I'm sure there's a whole lot more I need to ask to understand things, but I'll start here.

    Cheers!
    Ed

  • #2
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Option 1

    If you are using PHP you can use GET to keep the information.

    PHP Code:
    if (isset($_GET["x"])) {
        
    $x explode(":",$_GET["x"]);

        switch(
    $x[0])
        {
            case 
    'form1':
                
    form1($x[1]);
            break;

                    case 
    'form2':
                
    form2($x[2]);
            break;

                    case 
    'form3':
                
    form3($x[3]);
            break;

     }
    }

    function 
    form1($info) { 
    Option 2

    You can save the information into SESSIONS. This will keep the information until you unset it, or close the session.
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #3
    Regular Coder
    Join Date
    Jan 2010
    Posts
    101
    Thanks
    8
    Thanked 0 Times in 0 Posts
    masteroffollies: while I greatly appreciate the information, unfortunately I have no clue! I've just started on web building (on my own project - I'm not trying to butcher someone else's web site!), and I'm just beginning to learn HTML and JavaScript. My apologies for not being clearer about that.

    I've never been introduced to php, and I don't know what a SESSION is (except that it probably is the name for this current browsing session).

    Sorry!
    Ed

  • #4
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    I would give you the code, but then you wouldn't learn anything from it. Do what I did, go to the link before and read through the chapters. This is the very best PHP tutorial that I have seen and it's highly recommended. You can code your own script in as little as 10 minutes from reading it.

    http://www.w3schools.com/php/php_intro.asp
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #5
    Regular Coder
    Join Date
    Jan 2010
    Posts
    101
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Thank you!!! Much better than just the code!!

    If things start going up in smoke, I'll be back for more help.
    Ed

  • #6
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    No problem! Once you play with it and start learning, you can post in the PHP forum for help.
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?


  •  

    Posting Permissions

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