Re: [PHP] Multiple page form

2002-11-27 Thread Steve Keller
At 11/26/2002 10:42 AM, Shane  wrote:


It's been a while since I have done any PHP work. I am creating an online
employment application using multiple forms for a client. I was going to use
PHP. I don't remember if I need to pass variables along with the form for
each page, or can I just call them on the last page.


Shane, I recenty did a multi-page PHP form for a site that couldn't use a 
database. What I ended up doing in my own cludgy way was creating hidden 
form fields with each post, ie. extracting the http_post_vars and creating 
an  for each posted answer. This carried all the 
filled out questions across the pages, and, of course, I could echo answers 
to questions that were already given if the user went back to a previous page.

There was an additional hidden field for pageNo. The form POSTed to itself 
and INCLUDEd the section, ie. block of questions, specified by the pageNo.

The last page simply put all the answers together into a tab-delimited file 
and fired it off to the people who needed to see it so they could import it 
into spreadsheets.

The functional project is at:

http://alaskayouthmediaproject.org/survey/

And I'll gladly send you the code if you want, just Email me off the 
mailing list. It's far from perfect code, in fact I'd only been using PHP 
for two weeks or so when I wrote it, but I've gotten compliments on the 
ingenuity of it.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Multiple page form

2002-11-26 Thread @ Nilaab
Oh, ok. That makes a lot more sense. Thanks for the info John   :)

- Nilaab

> -Original Message-
> From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 26, 2002 4:00 PM
> To: @ Nilaab; [EMAIL PROTECTED]
> Subject: Re: [PHP] Multiple page form
>
>
> > Is there an actual way to store the data in a temporary table as you go
> > through the multi-page form and then extract that data from the
> temporary
> > storage from the DB App and either process the data or store it in a
> > permanent place?
> >
> > I have never done this before, but maybe someone else has? Any
> tips on how
> > to do this, what "type(s)" of DB tables are required to do this and can
> you
> > give me an url to help me research it further?
> >
> > I think this would be a great alternative to the sessions
> solution because
> > it doesn't work really well with some PHP error handling that
> you need to
> do
> > for the forms. You have to register and unregister variables throughout
> the
> > form and it gets hard to keep track of when you have so many forms and
> field
> > variables to deal with. With a temporary DB table, I can just insert any
> > data that has been checked for errors and then not have to worry about
> > passing them back and forth until the end of the application when I
> actually
> > need to do something with them.
>
> So don't add it to the session until you've verified the data.
> It's the same
> as using a temp table but you don't have to worry about the
> overhead of the
> database and you don't have to worry about cleanup with sessions.
>
> Also, a true TEMPORARY table will only be there for the current
> connection,
> so on the next page request, the table will be gone.
>
> ---John Holmes...
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Multiple page form

2002-11-26 Thread 1LT John W. Holmes
> Is there an actual way to store the data in a temporary table as you go
> through the multi-page form and then extract that data from the temporary
> storage from the DB App and either process the data or store it in a
> permanent place?
>
> I have never done this before, but maybe someone else has? Any tips on how
> to do this, what "type(s)" of DB tables are required to do this and can
you
> give me an url to help me research it further?
>
> I think this would be a great alternative to the sessions solution because
> it doesn't work really well with some PHP error handling that you need to
do
> for the forms. You have to register and unregister variables throughout
the
> form and it gets hard to keep track of when you have so many forms and
field
> variables to deal with. With a temporary DB table, I can just insert any
> data that has been checked for errors and then not have to worry about
> passing them back and forth until the end of the application when I
actually
> need to do something with them.

So don't add it to the session until you've verified the data. It's the same
as using a temp table but you don't have to worry about the overhead of the
database and you don't have to worry about cleanup with sessions.

Also, a true TEMPORARY table will only be there for the current connection,
so on the next page request, the table will be gone.

---John Holmes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Multiple page form

2002-11-26 Thread Jason Wong
On Wednesday 27 November 2002 05:11, [EMAIL PROTECTED] wrote:
> Is there an actual way to store the data in a temporary table as you go
> through the multi-page form and then extract that data from the temporary
> storage from the DB App and either process the data or store it in a
> permanent place?
>
> I have never done this before, but maybe someone else has? Any tips on how
> to do this, what "type(s)" of DB tables are required to do this and can you
> give me an url to help me research it further?

Search the documentation of your db of choice for "temporary table"

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Early to rise, early to bed, makes a man healthy, wealthy and dead.
-- Terry Pratchett, "The Light Fantastic"
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Multiple page form

2002-11-26 Thread @ Nilaab
Is there an actual way to store the data in a temporary table as you go
through the multi-page form and then extract that data from the temporary
storage from the DB App and either process the data or store it in a
permanent place?

I have never done this before, but maybe someone else has? Any tips on how
to do this, what "type(s)" of DB tables are required to do this and can you
give me an url to help me research it further?

I think this would be a great alternative to the sessions solution because
it doesn't work really well with some PHP error handling that you need to do
for the forms. You have to register and unregister variables throughout the
form and it gets hard to keep track of when you have so many forms and field
variables to deal with. With a temporary DB table, I can just insert any
data that has been checked for errors and then not have to worry about
passing them back and forth until the end of the application when I actually
need to do something with them.

- Nilaab



> -Original Message-
> From: Chris Boget [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 26, 2002 10:24 AM
> To: @ Edwin; Shane McBride
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Multiple page form
>
>
> > > Yes.  What's the point in taking the user's information if you aren't
> > > going to store it somewhere.  Even if all you need to do is email
> > > the data upon completion of the form, storing the data for later use
> > > would be a good idea.
> > Not always. Are your users aware of this?
> > Just wondering...
>
> Yes.
> Though, the "later use" I refer to is internal only.  We sell no data.
>
> Chris
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Multiple page form

2002-11-26 Thread Chris Boget
> > Yes.  What's the point in taking the user's information if you aren't
> > going to store it somewhere.  Even if all you need to do is email
> > the data upon completion of the form, storing the data for later use
> > would be a good idea.
> Not always. Are your users aware of this?
> Just wondering...

Yes.
Though, the "later use" I refer to is internal only.  We sell no data.

Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Multiple page form

2002-11-26 Thread @ Edwin

"Chris Boget" <[EMAIL PROTECTED]> wrote:

> > So, you are using a database to store the records?
> 
> Yes.  What's the point in taking the user's information if you aren't
> going to store it somewhere.  Even if all you need to do is email
> the data upon completion of the form, storing the data for later use
> would be a good idea.

Not always. Are your users aware of this?

Just wondering...

- E

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Multiple page form

2002-11-26 Thread Chris Boget
> > Yes.  What's the point in taking the user's information if you
> > aren't going to store it somewhere. Even if all you need to do is
> > email the data upon completion of the form, storing the data for
> > later use would be a good idea.
> Since it seems like you are inferring otherwise, I should say that a
> database isn't the only way to store information.

Of course there are.  And if I infered otherwise, that was not my 
intention.
 
> Also, many multiple page forms like this are for some sort of user
> registration or similar task where you might want the entire process
> completed prior to creating a user record. Perhaps he doesn't want to
> create the record in the database prior to the user finishing all the
> screens.

But even incomplete records can have useful information.  What page did 
the user stop at, for example.  Keeping this kind of data in a permanent
store has use even beyond the application.

> Sessions are the more straightforward approach to keeping up with
> data like this. 

Perhaps.  Depends on what, ultimately, you want to use the data for.

> After all, not everything warrants permanent storage,
> which is why most Web applications generally have two data stores:
> 1. Permanent user record data store (where you might store username
> and password, for example)
> 2. Session data store (where you might store whether a user is logged
> in or keep up with form data from page to page)

We always have a permanent store, keeping even the incomplete records.
It helps us out in alot of other ways.

Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Multiple page form

2002-11-26 Thread Chris Shiflett
--- Chris Boget <[EMAIL PROTECTED]> wrote:

> > So, you are using a database to store the records?
> 
> Yes.  What's the point in taking the user's information if you
> aren't going to store it somewhere. Even if all you need to do is
> email the data upon completion of the form, storing the data for
> later use would be a good idea.

Since it seems like you are inferring otherwise, I should say that a
database isn't the only way to store information.

Also, many multiple page forms like this are for some sort of user
registration or similar task where you might want the entire process
completed prior to creating a user record. Perhaps he doesn't want to
create the record in the database prior to the user finishing all the
screens.

Sessions are the more straightforward approach to keeping up with
data like this. After all, not everything warrants permanent storage,
which is why most Web applications generally have two data stores:

1. Permanent user record data store (where you might store username
and password, for example)
2. Session data store (where you might store whether a user is logged
in or keep up with form data from page to page)

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Multiple page form

2002-11-26 Thread Chris Boget
> So, you are using a database to store the records?

Yes.  What's the point in taking the user's information if you aren't
going to store it somewhere.  Even if all you need to do is email
the data upon completion of the form, storing the data for later use
would be a good idea.

Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Multiple page form

2002-11-26 Thread Shane McBride
So, you are using a database to store the records?

-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 10:45 AM
To: Shane McBride; [EMAIL PROTECTED]
Subject: Re: [PHP] Multiple page form


> It's been a while since I have done any PHP work. I am creating an online
> employment application using multiple forms for a client. I was going to
use
> PHP. I don't remember if I need to pass variables along with the form for
> each page, or can I just call them on the last page.
> The application form is very long. Any ideas? There may be a script that
> exists already?

What I usually do for my multi-page form is INSERT the data to a table on
the first page then UPDATE that record on subsequent pages.  The only
thing I need to pass on is the primary key value for the record.

Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Multiple page form

2002-11-26 Thread Chris Shiflett
--- Shane McBride <[EMAIL PROTECTED]> wrote:

> I don't remember if I need to pass variables along with the
> form for each page, or can I just call them on the last page.

Consider using sessions:

http://www.php.net/manual/en/ref.session.php

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Multiple page form

2002-11-26 Thread Chris Boget
> It's been a while since I have done any PHP work. I am creating an online
> employment application using multiple forms for a client. I was going to use
> PHP. I don't remember if I need to pass variables along with the form for
> each page, or can I just call them on the last page.
> The application form is very long. Any ideas? There may be a script that
> exists already?

What I usually do for my multi-page form is INSERT the data to a table on
the first page then UPDATE that record on subsequent pages.  The only
thing I need to pass on is the primary key value for the record.

Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Multiple page form

2002-11-26 Thread Shane McBride
Hi there.

It's been a while since I have done any PHP work. I am creating an online
employment application using multiple forms for a client. I was going to use
PHP. I don't remember if I need to pass variables along with the form for
each page, or can I just call them on the last page.

The application form is very long. Any ideas? There may be a script that
exists already?

Anyway, it's nice to be back.

- Shane



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Multiple Page Form

2001-01-23 Thread Benjamin Munoz


Make sure you are not forgetting to include $action as a hidden input, so
your script can know how to process.

, for example

-Ben

-Original Message-
From: Jeremy Bowen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 12:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Multiple Page Form


hey,

I am sure this is a dumb question but, I cannot seem to find out what i am
doing wrong. 

I have a three page form, it basically takes a users input, displays it on
the
next page to make sure the users info is correct (i store the variables on
this page in a form in hidden input tags), when the user clicks subscribe on
this page it is supposed to go on to the third page which is a confirmation
page. We instead of doing that it just reloads the page and resets all of
the
values!

My form looks something like this (This is a simplified version):










}

elseif ($action="Send")

{


PAGE TWO




$name 
$email 





}

elseif ($action="Send")

{


Thanks for Subscribing!

mail("Args","Args","Args");

}

?>

I have looked on php.net but i cannot seem to find docs on how to do this!

Thanks,

Jeremy






 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Multiple Page Form

2001-01-23 Thread Jeremy Bowen

hey,

I am sure this is a dumb question but, I cannot seem to find out what i am
doing wrong. 

I have a three page form, it basically takes a users input, displays it on the
next page to make sure the users info is correct (i store the variables on
this page in a form in hidden input tags), when the user clicks subscribe on
this page it is supposed to go on to the third page which is a confirmation
page. We instead of doing that it just reloads the page and resets all of the
values!

My form looks something like this (This is a simplified version):










}

elseif ($action="Send")

{


PAGE TWO




$name 
$email 





}

elseif ($action="Send")

{


Thanks for Subscribing!

mail("Args","Args","Args");

}

?>

I have looked on php.net but i cannot seem to find docs on how to do this!

Thanks,

Jeremy






 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]