...

View Full Version : Help understanding forms, please?



EdNerd
01-27-2010, 03:45 PM
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

masterofollies
01-27-2010, 04:59 PM
Option 1

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


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.

EdNerd
01-27-2010, 06:27 PM
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

masterofollies
01-27-2010, 10:20 PM
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

EdNerd
01-27-2010, 11:13 PM
Thank you!!! Much better than just the code!!

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

masterofollies
01-28-2010, 05:03 AM
No problem! Once you play with it and start learning, you can post in the PHP forum for help.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum