Re: [PHP] Saving form data into session before leaving a page

2010-04-14 Thread Ashley Sheridan
On Wed, 2010-04-14 at 06:49 +0100, Lester Caine wrote:

 Nathan Rixham wrote:
  Peter Lind wrote:
  On 13 April 2010 17:27, Paul M Fosterpa...@quillandmouse.com  wrote:
  On Tue, Apr 13, 2010 at 03:20:23PM +0200, Merlin Morgenstern wrote:
 
  Hello everybody,
 
  I have form where users enter data to be saved in a db.
 
  How can I make php save the form data into a session before the user
  leaves the page without pressing the submit button? Some members leave
  the page and return afterwards wondering where their already entered
  data is.
  I hate to be a contrarian (not really), but there is a paradigm for
  using web forms. If you want the internet to save your data, you have to
  press the little button. If you don't, then it won't be saved. Not hard
  to figure out, not hard to do. If you have to go do something else while
  you're in the middle of a form, open a new tab/window and do it. When
  you come back to your original form, the data will still be there (but
  again, not *saved* until you hit the little button).
 
  Sorry, I just get cranky with people who won't follow the rules.
 
  There are rules and then there's stupidity based on tradition. The
  fact that websites previously threw away whatever work you had done
  because you automatically got logged out of your session after half an
  hour of typing does not mean you should call this a rule that should
  be adhere to. Google figured it out and did so well: backup
  automatically and let the user discard manually - not the other way
  round that leads to lost work.
 
  Apart from that, I note that the OP has seemingly managed to solve the
  problem and all these emails are rather pointless.
 
  Concur, and this is nothing to do with the web; http only constrains
  that the data should be POSTed or PUT; not /when/ a save action is
  triggered.
 
  Functionality is in the realm of the application, and if the client
  application (in this case the web page) determines that information
  should be iteratively saved, then that's what it should do.
 
  see google docs, gmail etc for real world examples.
 
 And a few BANK sites could do with considering waring people that they will 
 time 
 out before you have time to actually write in their message box for on-line 
 emails which you have to use since they will not accept off-line ones. I had 
 a 
 complex message FROM them to answer - and save just told me the seesion had 
 timed out! Bank solution - I should have copied their message to a word 
 processor, and then copied the answer back later ... perhaps they should add 
 that with a warning when trying to use their email page ;)
 
 -- 
 Lester Caine - G8HFL
 -
 Contact - http://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk
 EnquirySolve - http://enquirysolve.com/
 Model Engineers Digital Workshop - http://medw.co.uk//
 Firebird - http://www.firebirdsql.org/index.php
 


Banks are notorious for not knowing about technology. My bank has a
constant popup for Windows software that I 'must install' and has even
asked me before to send my bank details over unencrypted email (my
actual bank and not a phishing scam, as it was in reply to a question
about that darned popup!)

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Peter Lind
On 13 April 2010 15:20, Merlin Morgenstern merli...@fastmail.fm wrote:
 Hello everybody,

 I have form where users enter data to be saved in a db.

 How can I make php save the form data into a session before the user leaves
 the page without pressing the submit button? Some members leave the page and
 return afterwards wondering where their already entered data is.

 Any ideas how to save into php session data before someone leaves the page?

Use ajax: send a query to the server a couple of seconds after the
user has last updated the form.

 Thank you for any hint,

 Merlin

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





-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
/hype

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Ashley Sheridan
On Tue, 2010-04-13 at 15:20 +0200, Merlin Morgenstern wrote:

 Hello everybody,
 
 I have form where users enter data to be saved in a db.
 
 How can I make php save the form data into a session before the user 
 leaves the page without pressing the submit button? Some members leave 
 the page and return afterwards wondering where their already entered 
 data is.
 
 Any ideas how to save into php session data before someone leaves the page?
 
 Thank you for any hint,
 
 Merlin
 


Session data is all stored on the server, so it requires a submit in
order for the server to actually get the data.

You could use Ajax to grab the form data and send it to the server if
you need though.

However, I'm not really sure what your question is. Are people visiting
your site, filling in a form, then pressing the back button to go
somewhere else? If so, maybe they intended to not submit the form.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Paul M Foster
On Tue, Apr 13, 2010 at 03:20:23PM +0200, Merlin Morgenstern wrote:

 Hello everybody,

 I have form where users enter data to be saved in a db.

 How can I make php save the form data into a session before the user
 leaves the page without pressing the submit button? Some members leave
 the page and return afterwards wondering where their already entered
 data is.

I hate to be a contrarian (not really), but there is a paradigm for
using web forms. If you want the internet to save your data, you have to
press the little button. If you don't, then it won't be saved. Not hard
to figure out, not hard to do. If you have to go do something else while
you're in the middle of a form, open a new tab/window and do it. When
you come back to your original form, the data will still be there (but
again, not *saved* until you hit the little button).

Sorry, I just get cranky with people who won't follow the rules.

Paul

-- 
Paul M. Foster

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread tedd

At 11:27 AM -0400 4/13/10, Paul M Foster wrote:

On Tue, Apr 13, 2010 at 03:20:23PM +0200, Merlin Morgenstern wrote:


 Hello everybody,

 I have form where users enter data to be saved in a db.

 How can I make php save the form data into a session before the user
 leaves the page without pressing the submit button? Some members leave
 the page and return afterwards wondering where their already entered
 data is.


I hate to be a contrarian (not really), but there is a paradigm for
using web forms. If you want the internet to save your data, you have to
press the little button. If you don't, then it won't be saved. Not hard
to figure out, not hard to do. If you have to go do something else while
you're in the middle of a form, open a new tab/window and do it. When
you come back to your original form, the data will still be there (but
again, not *saved* until you hit the little button).

Sorry, I just get cranky with people who won't follow the rules.

Paul


Paul:

What rules? I didn't see any rules. There are simply easy ways to do 
things and those not so easy -- like jumping out the window or using 
the stairs. You arrive at the same place, but at what cost?


In this case, I don't think the OP has provided us with enough 
information about his problem.


If he is concerned that his users may return to a page and wants the 
fields filled with what the user previously entered, then that 
depends upon several different things, such as has the user shut down 
his browser, or has the user simply clicked the submit button and the 
page has been refreshed. IOW, how has the user left the page?


So, OP explain what you are trying to do?

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Kevin Kinsey

Paul M Foster wrote:


Sorry, I just get cranky with people who won't follow the rules.



?php

$pauls_post++;

?

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Dan Joseph
On Tue, Apr 13, 2010 at 12:19 PM, tedd tedd.sperl...@gmail.com wrote:

 So, OP explain what you are trying to do?

 Cheers,

 tedd


Sorta looks to me like he's in a situation where users are fleeing the form,
and wondering why its not filled in when they go back.  The natural reaction
for this would be to call it abnormal, and tell them to learn how to use a
web page, but we all know how the real world is.

I like the original ideas from Peter and Ashley.  Store a session or cookie,
use ajax to periodically update a database table with the information, then
re-populate it if/when they come back.

I kinda like that word Paradigm.  Rolls off the tongue nicely.  I'm going to
use it 3 times today before I leave the office.

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code NEWTHINGS for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry


Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Robert Cummings

Dan Joseph wrote:

On Tue, Apr 13, 2010 at 12:19 PM, tedd tedd.sperl...@gmail.com wrote:


So, OP explain what you are trying to do?

Cheers,

tedd



Sorta looks to me like he's in a situation where users are fleeing the form,
and wondering why its not filled in when they go back.  The natural reaction
for this would be to call it abnormal, and tell them to learn how to use a
web page, but we all know how the real world is.

I like the original ideas from Peter and Ashley.  Store a session or cookie,
use ajax to periodically update a database table with the information, then
re-populate it if/when they come back.

I kinda like that word Paradigm.  Rolls off the tongue nicely.  I'm going to
use it 3 times today before I leave the office.


I had a pair-a-dimes one time. Unfortunately I was a nickel short of a 
quarter to put in the slot.


:)

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Dan Joseph
On Tue, Apr 13, 2010 at 12:40 PM, Robert Cummings rob...@interjinn.comwrote

 I had a pair-a-dimes one time. Unfortunately I was a nickel short of a
 quarter to put in the slot.

 But the question is... were they outside the box?

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code NEWTHINGS for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry


Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Kevin Kinsey

Dan Joseph wrote:

On Tue, Apr 13, 2010 at 12:40 PM, Robert Cummings rob...@interjinn.comwrote


I had a pair-a-dimes one time. Unfortunately I was a nickel short of a
quarter to put in the slot.

But the question is... were they outside the box?




Nah, the question is, since the slot was intended to accept a quarter,
why the heck didn't it take two dimes and a nickel ... or just two dimes,
and throw a nickel in gratis?

I must be getting old.  We have toilets that flush themselves now.
WTF happened to grown up being equal to taking responsibility
for things?

KDK

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Dan Joseph
On Tue, Apr 13, 2010 at 12:48 PM, Kevin Kinsey k...@daleco.biz wrote:

 Nah, the question is, since the slot was intended to accept a quarter,
 why the heck didn't it take two dimes and a nickel ... or just two dimes,
 and throw a nickel in gratis?

 I must be getting old.  We have toilets that flush themselves now.
 WTF happened to grown up being equal to taking responsibility
 for things?


I think you've found the answer to the great question of why people don't
take responsibility anymore...  it all started with the toilet!

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code NEWTHINGS for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry


Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Paul M Foster
On Tue, Apr 13, 2010 at 12:36:02PM -0400, Dan Joseph wrote:

snip

 I kinda like that word Paradigm.  Rolls off the tongue nicely.  I'm going to
 use it 3 times today before I leave the office. 

ROTFL!

Paul

-- 
Paul M. Foster

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread tedd

At 12:40 PM -0400 4/13/10, Robert Cummings wrote:

Dan Joseph wrote:

On Tue, Apr 13, 2010 at 12:19 PM, tedd tedd.sperl...@gmail.com wrote:


So, OP explain what you are trying to do?

Cheers,

tedd



Sorta looks to me like he's in a situation where users are fleeing the form,
and wondering why its not filled in when they go back.  The natural reaction
for this would be to call it abnormal, and tell them to learn how to use a
web page, but we all know how the real world is.

I like the original ideas from Peter and Ashley.  Store a session or cookie,
use ajax to periodically update a database table with the information, then
re-populate it if/when they come back.

I kinda like that word Paradigm.  Rolls off the tongue nicely.  I'm going to
use it 3 times today before I leave the office.


I had a pair-a-dimes one time. Unfortunately I was a nickel short of 
a quarter to put in the slot.


:)

Cheers,
Rob.


Rob:

I had a pair-a-ducks -- but they were afoul fowl.

I had a pair-a-dice -- but crapped out.

I had a pair-a-chute -- but one was shorter.

I had a pair-of-pants -- but could only find one.

Cheers,

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Robert Cummings

Dan Joseph wrote:

On Tue, Apr 13, 2010 at 12:40 PM, Robert Cummings rob...@interjinn.comwrote


I had a pair-a-dimes one time. Unfortunately I was a nickel short of a
quarter to put in the slot.




But the question is... were they outside the box?


They were in my pocket... so yes!

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Robert Cummings

Kevin Kinsey wrote:

Dan Joseph wrote:

On Tue, Apr 13, 2010 at 12:40 PM, Robert Cummings rob...@interjinn.comwrote


I had a pair-a-dimes one time. Unfortunately I was a nickel short of a
quarter to put in the slot.

But the question is... were they outside the box?


Nah, the question is, since the slot was intended to accept a quarter,
why the heck didn't it take two dimes and a nickel ... or just two dimes,
and throw a nickel in gratis?


I've never known an arcade machine to accept nickels and dimes :)


I must be getting old.  We have toilets that flush themselves now.
WTF happened to grown up being equal to taking responsibility
for things?


Toilets flush themselves so that we don't need to touch what someone 
else touched... very likely after *cough* wiping up.


Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Robert Cummings



tedd wrote:

At 12:40 PM -0400 4/13/10, Robert Cummings wrote:

Dan Joseph wrote:

On Tue, Apr 13, 2010 at 12:19 PM, tedd tedd.sperl...@gmail.com wrote:


So, OP explain what you are trying to do?

Cheers,

tedd


Sorta looks to me like he's in a situation where users are fleeing the form,
and wondering why its not filled in when they go back.  The natural reaction
for this would be to call it abnormal, and tell them to learn how to use a
web page, but we all know how the real world is.

I like the original ideas from Peter and Ashley.  Store a session or cookie,
use ajax to periodically update a database table with the information, then
re-populate it if/when they come back.

I kinda like that word Paradigm.  Rolls off the tongue nicely.  I'm going to
use it 3 times today before I leave the office.
I had a pair-a-dimes one time. Unfortunately I was a nickel short of 
a quarter to put in the slot.


:)

Cheers,
Rob.


Rob:

I had a pair-a-ducks -- but they were afoul fowl.

I had a pair-a-dice -- but crapped out.

I had a pair-a-chute -- but one was shorter.

I had a pair-of-pants -- but could only find one.


So to paraphrase...

You had a pair-a-ducks that lived in pair-a-dice but when pair-a-chuting 
 only one could find a pair-a-pants because the other one was shorter?


Gotcha... clear as tar!

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Dan Joseph
On Tue, Apr 13, 2010 at 1:46 PM, Robert Cummings rob...@interjinn.comwrote:


 Toilets flush themselves so that we don't need to touch what someone else
 touched... very likely after *cough* wiping up.



They have a cure for having to life a finger and wipe also  but I won't
continue lol

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code NEWTHINGS for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry


Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Peter Lind
On 13 April 2010 17:27, Paul M Foster pa...@quillandmouse.com wrote:
 On Tue, Apr 13, 2010 at 03:20:23PM +0200, Merlin Morgenstern wrote:

 Hello everybody,

 I have form where users enter data to be saved in a db.

 How can I make php save the form data into a session before the user
 leaves the page without pressing the submit button? Some members leave
 the page and return afterwards wondering where their already entered
 data is.

 I hate to be a contrarian (not really), but there is a paradigm for
 using web forms. If you want the internet to save your data, you have to
 press the little button. If you don't, then it won't be saved. Not hard
 to figure out, not hard to do. If you have to go do something else while
 you're in the middle of a form, open a new tab/window and do it. When
 you come back to your original form, the data will still be there (but
 again, not *saved* until you hit the little button).

 Sorry, I just get cranky with people who won't follow the rules.

There are rules and then there's stupidity based on tradition. The
fact that websites previously threw away whatever work you had done
because you automatically got logged out of your session after half an
hour of typing does not mean you should call this a rule that should
be adhere to. Google figured it out and did so well: backup
automatically and let the user discard manually - not the other way
round that leads to lost work.

Apart from that, I note that the OP has seemingly managed to solve the
problem and all these emails are rather pointless.



-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
/hype

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Nathan Rixham
Peter Lind wrote:
 On 13 April 2010 17:27, Paul M Foster pa...@quillandmouse.com wrote:
 On Tue, Apr 13, 2010 at 03:20:23PM +0200, Merlin Morgenstern wrote:

 Hello everybody,

 I have form where users enter data to be saved in a db.

 How can I make php save the form data into a session before the user
 leaves the page without pressing the submit button? Some members leave
 the page and return afterwards wondering where their already entered
 data is.
 I hate to be a contrarian (not really), but there is a paradigm for
 using web forms. If you want the internet to save your data, you have to
 press the little button. If you don't, then it won't be saved. Not hard
 to figure out, not hard to do. If you have to go do something else while
 you're in the middle of a form, open a new tab/window and do it. When
 you come back to your original form, the data will still be there (but
 again, not *saved* until you hit the little button).

 Sorry, I just get cranky with people who won't follow the rules.
 
 There are rules and then there's stupidity based on tradition. The
 fact that websites previously threw away whatever work you had done
 because you automatically got logged out of your session after half an
 hour of typing does not mean you should call this a rule that should
 be adhere to. Google figured it out and did so well: backup
 automatically and let the user discard manually - not the other way
 round that leads to lost work.
 
 Apart from that, I note that the OP has seemingly managed to solve the
 problem and all these emails are rather pointless.

Concur, and this is nothing to do with the web; http only constrains
that the data should be POSTed or PUT; not /when/ a save action is
triggered.

Functionality is in the realm of the application, and if the client
application (in this case the web page) determines that information
should be iteratively saved, then that's what it should do.

see google docs, gmail etc for real world examples.

Regards!

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



Re: [PHP] Saving form data into session before leaving a page

2010-04-13 Thread Lester Caine

Nathan Rixham wrote:

Peter Lind wrote:

On 13 April 2010 17:27, Paul M Fosterpa...@quillandmouse.com  wrote:

On Tue, Apr 13, 2010 at 03:20:23PM +0200, Merlin Morgenstern wrote:


Hello everybody,

I have form where users enter data to be saved in a db.

How can I make php save the form data into a session before the user
leaves the page without pressing the submit button? Some members leave
the page and return afterwards wondering where their already entered
data is.

I hate to be a contrarian (not really), but there is a paradigm for
using web forms. If you want the internet to save your data, you have to
press the little button. If you don't, then it won't be saved. Not hard
to figure out, not hard to do. If you have to go do something else while
you're in the middle of a form, open a new tab/window and do it. When
you come back to your original form, the data will still be there (but
again, not *saved* until you hit the little button).

Sorry, I just get cranky with people who won't follow the rules.


There are rules and then there's stupidity based on tradition. The
fact that websites previously threw away whatever work you had done
because you automatically got logged out of your session after half an
hour of typing does not mean you should call this a rule that should
be adhere to. Google figured it out and did so well: backup
automatically and let the user discard manually - not the other way
round that leads to lost work.

Apart from that, I note that the OP has seemingly managed to solve the
problem and all these emails are rather pointless.


Concur, and this is nothing to do with the web; http only constrains
that the data should be POSTed or PUT; not /when/ a save action is
triggered.

Functionality is in the realm of the application, and if the client
application (in this case the web page) determines that information
should be iteratively saved, then that's what it should do.

see google docs, gmail etc for real world examples.


And a few BANK sites could do with considering waring people that they will time 
out before you have time to actually write in their message box for on-line 
emails which you have to use since they will not accept off-line ones. I had a 
complex message FROM them to answer - and save just told me the seesion had 
timed out! Bank solution - I should have copied their message to a word 
processor, and then copied the answer back later ... perhaps they should add 
that with a warning when trying to use their email page ;)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] saving form data - calling another script from PHP?

2004-02-24 Thread Charlie Fiskeaux II
Gary Sanders wrote:

Charlie,

Can you make the submit target be the PHP script and have the PHP script
call the Perl script to send the email?
Sure, that would definitely work; I just don't know how to 
call the Perl script and pass the data (and 
uploaded/attached files) to it.

--

Charlie Fiskeaux II
Media Designer
Cre8tive Group
cre8tivegroup.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] saving form data

2004-02-23 Thread Sam Masiello

If the PHP configuration doesn't have register_globals turned on in
the php.ini file, you will be able to access the form variables via the
_POST array like this:

$_POST[my_form_var]

Of course, substitute my_form_var with the correct variable from the
form that you are submitting.

If the server does have register_globals turned on you can access the
variables just as they are named in the form.  For example, if you have
a text input field named lastname, you can access the value in that
text box using the variable $lastname.

HTH!

--Sam



Charlie Fiskeaux II wrote:
 I'm using a prebuilt Perl form mailer script for a project,
 but because the form is so long, my client would like to
 give the user the ability to save the data and come back to
 finish it later. I was hoping to be able to code this part
 in PHP (because I don't know Perl), but I'm fairly new to
 PHP and don't know how to get one form to go to two
 different places. Because the target of the form is the Perl
 script (for emailing the submitted form), how can I grab the
 data from the form with PHP?
 
 --
 
 Charlie Fiskeaux II
 Media Designer
 Cre8tive Group
 cre8tivegroup.com

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



Re: [PHP] saving form data

2004-02-23 Thread Charlie Fiskeaux II
Sam Masiello wrote:

If the PHP configuration doesn't have register_globals turned on in
the php.ini file, you will be able to access the form variables via the
_POST array like this:
$_POST[my_form_var]

Of course, substitute my_form_var with the correct variable from the
form that you are submitting.
If the server does have register_globals turned on you can access the
variables just as they are named in the form.  For example, if you have
a text input field named lastname, you can access the value in that
text box using the variable $lastname.
Thanks, but how do I get the info submitted to the PHP 
script to access the data in the first place? Since the 
target of the form is the Perl script, the submit button 
submits the form to the Perl script; can I add a second 
button of some type to submit the form to a different 
location (the PHP script)? Or can I use the DOM (ie 
document.formname.fieldname.value) to grab the data straight 
from the fields and then pass it on somehow?

--

Charlie Fiskeaux II
Media Designer
Cre8tive Group
cre8tivegroup.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] saving form data

2004-02-23 Thread Charlie Fiskeaux II
Richard Davey wrote:

You can't make one form submit to two different scripts sadly, but to
be honest if you're going to write a PHP script to capture this
information - why not make it do what the Perl formmail script does
too? (i.e. send the email) and remove the Perl script from the
equation?
It's just a matter of development time; if there's a way to 
use the Perl mail script with a PHP data saving script, it 
would save time. If I do have to rewrite the whole thing in 
PHP, how would I accept uploaded file attachments and attach 
them to the emailed form results?

--

Charlie Fiskeaux II
Media Designer
Cre8tive Group
cre8tivegroup.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] saving form data

2004-02-23 Thread Gary Sanders
Charlie,

Can you make the submit target be the PHP script and have the PHP script
call the Perl script to send the email?

Gary

 -Original Message-
 From: Charlie Fiskeaux II [mailto:[EMAIL PROTECTED] 
 Sent: Monday, February 23, 2004 2:15 PM
 To: PHP General
 Subject: Re: [PHP] saving form data
 
 
 Richard Davey wrote:
 
  You can't make one form submit to two different scripts 
 sadly, but to 
  be honest if you're going to write a PHP script to capture this 
  information - why not make it do what the Perl formmail script does 
  too? (i.e. send the email) and remove the Perl script from the 
  equation?
  
 
 It's just a matter of development time; if there's a way to 
 use the Perl mail script with a PHP data saving script, it 
 would save time. If I do have to rewrite the whole thing in 
 PHP, how would I accept uploaded file attachments and attach 
 them to the emailed form results?
 
 -- 
 
 Charlie Fiskeaux II
 Media Designer
 Cre8tive Group
 cre8tivegroup.com
 
 -- 
 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] saving form data

2004-02-23 Thread Evan Nemerson
On Monday 23 February 2004 02:51 pm, Charlie Fiskeaux II wrote:
 Richard Davey wrote:
  CFI It's just a matter of development time; if there's a way to
  CFI use the Perl mail script with a PHP data saving script, it
  CFI would save time. If I do have to rewrite the whole thing in
  CFI PHP, how would I accept uploaded file attachments and attach
  CFI them to the emailed form results?
 
  Then how about in reverse? Add something to the end of the Perl script
  that passes the values to a PHP script? It could even do it via the
  query string, maybe also passing an md5 encoded password that only
  your two scripts know (in order to stop someone spoofing your script).

 I don't think that would work because they will need to save
 without sending the form. But I had thought about the
 reverse: a PHP script that saves the data and then possibly
 passes it on to the Perl script.

 Do you or anyone else know how to pass on form results in
 PHP to another script? (Like I said, I'm pretty new to PHP...)

Well you could try using an HTTP 302 Found or 307 Temporary Redirect, but IIRC 
clients must not redirect the request unless the response is received in 
response to a GET or HEAD request, so you'd have to use GET. I seem to 
remember reading something about uploading files, which is kinda difficult 
with GET...

Possibly your best option would be to send a POST request through the HTTPD 
via a socket- there are libraries out there to help you do this easily, try 
PEAR, hotscripts, phpclasses, etc.

 Thanks!

 --

 Charlie Fiskeaux II
 Media Designer
 Cre8tive Group
 cre8tivegroup.com
 859/858-9054x29
 cell: 859/608-9194

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

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



Re: [PHP] saving form data

2004-02-23 Thread Charlie Fiskeaux II
Richard Davey wrote:

CFI It's just a matter of development time; if there's a way to 
CFI use the Perl mail script with a PHP data saving script, it 
CFI would save time. If I do have to rewrite the whole thing in 
CFI PHP, how would I accept uploaded file attachments and attach 
CFI them to the emailed form results?

Then how about in reverse? Add something to the end of the Perl script
that passes the values to a PHP script? It could even do it via the
query string, maybe also passing an md5 encoded password that only
your two scripts know (in order to stop someone spoofing your script).
I don't think that would work because they will need to save 
without sending the form. But I had thought about the 
reverse: a PHP script that saves the data and then possibly 
passes it on to the Perl script.

Do you or anyone else know how to pass on form results in 
PHP to another script? (Like I said, I'm pretty new to PHP...)

Thanks!

--

Charlie Fiskeaux II
Media Designer
Cre8tive Group
cre8tivegroup.com
859/858-9054x29
cell: 859/608-9194
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Saving Form Data

2003-10-10 Thread Burhan Khalid
PHP wrote:

[ snip ]

I think I need some kind of HTML parser that will break up the supervisors
form, then insert any values need for the form values and then re-display
the form data.
Well, if you insert the XML declaration at the top, and make sure your 
page validates as XHTML, I believe you can use the xml_dom* and 
xml_parser (SAX) functions to parse your file.

I haven't tried it personally, but I hear that it can be done with the 
sax parser (from the fine poeple at #php)

Worth a try. http://www.php.net/xml

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Saving Form Data

2003-10-08 Thread Jay Blanchard
[snip]
Is there anyway of saving a form with layout and data, without knowing
what the fields are?
I would like to be able to have the use Upload there own form. Then
that form can be later viewed and filled out by someone else and be able
to save all the data that was entered.
I can do this easy enough with Text and Textarea type fields, but things
like selects, radios, etc I can't think of a way to save them. 
Basically It would be like save a screen capture of the filled out form
for viewing/altering later.
[/snip]

If the form method is POST all of the data is in the $_POST array which
could be saved to a text file, if GET all of the data is in the $_GET
array. You would have to read out of the saved text file to re-populate
the form for editing or viewing later

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



Re: [PHP] Saving Form Data

2003-10-08 Thread PHP
Unfortuanetly that would only work for Text and Textarea types.
It wouldn't really for for a select, bcause how do you know which option of
the form was selected?
How do you select the correct option without knowing what the other options
are?
Ex, a user uploads a form with a select type like so:

select name=Month
option value=JanJan/option
option value=FebFeb/option
/select.

Your post value would be Month=Feb, if Feb was selected when the form was
filled out.

Now, I load the form again, I know that Month = Feb, but how to I now make
the form preselect the Option? I would somehow have to parse the form data
and look for the select of Month and then look through all the options for
Feb and insert a selected statement in the form in that spot.

- Original Message - 
From: Jay Blanchard [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]; php [EMAIL PROTECTED]
Sent: Wednesday, October 08, 2003 12:58 PM
Subject: RE: [PHP] Saving Form Data


 [snip]
 Is there anyway of saving a form with layout and data, without knowing
 what the fields are?
 I would like to be able to have the use Upload there own form. Then
 that form can be later viewed and filled out by someone else and be able
 to save all the data that was entered.
 I can do this easy enough with Text and Textarea type fields, but things
 like selects, radios, etc I can't think of a way to save them.
 Basically It would be like save a screen capture of the filled out form
 for viewing/altering later.
 [/snip]

 If the form method is POST all of the data is in the $_POST array which
 could be saved to a text file, if GET all of the data is in the $_GET
 array. You would have to read out of the saved text file to re-populate
 the form for editing or viewing later

 -- 
 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] Saving Form Data

2003-10-08 Thread Marek Kilimajer
PHP wrote:
Hi,
Is there anyway of saving a form with layout and data, without knowing what the fields are?
I would like to be able to have the use Upload there own form. Then that form can be later viewed and filled out by someone else and be able to save all the data that was entered.
I can do this easy enough with Text and Textarea type fields, but things like selects, radios, etc I can't think of a way to save them. 
Basically It would be like save a screen capture of the filled out form for viewing/altering later.

Thanks for any help.


radio:
input type=radio name=name value=1?= ($_POST['name']=='1' ? ' 
checked': '') ?
input type=radio name=order_type value=2?= ((!$_POST['name'] || 
$_POST['name']=='2') ? ' checked': '') ?

select:
select name=name
option value=1?= ($_POST['name']=='1' ? ' selected': '') ? ONE 
/option
option value=2?= ($_POST['order_type']=='2' ? ' selected': '') ? 
TWO /option

checkbox:
input type=checkbox name=name value=1?= ($_POST['name']=='1' ? ' 
checked': '') ?

You cannot save file input that easily, you have to keep the file on the 
server and give the user oportunity to change it.

Marek

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


Re: [PHP] Saving Form Data

2003-10-08 Thread PHP
Thanks,
I thought of this, unfortuanetly the user uploading the form would have no
clue in being able to build the form with the $_POST tags already in it.

 PHP wrote:
  Hi,
  Is there anyway of saving a form with layout and data, without knowing
what the fields are?
  I would like to be able to have the use Upload there own form. Then
that form can be later viewed and filled out by someone else and be able to
save all the data that was entered.
  I can do this easy enough with Text and Textarea type fields, but things
like selects, radios, etc I can't think of a way to save them.
  Basically It would be like save a screen capture of the filled out form
for viewing/altering later.
 
  Thanks for any help.


 radio:
 input type=radio name=name value=1?= ($_POST['name']=='1' ? '
 checked': '') ?
 input type=radio name=order_type value=2?= ((!$_POST['name'] ||
 $_POST['name']=='2') ? ' checked': '') ?

 select:
 select name=name
 option value=1?= ($_POST['name']=='1' ? ' selected': '') ? ONE
 /option
 option value=2?= ($_POST['order_type']=='2' ? ' selected': '') ?
 TWO /option

 checkbox:
 input type=checkbox name=name value=1?= ($_POST['name']=='1' ? '
 checked': '') ?

 You cannot save file input that easily, you have to keep the file on the
 server and give the user oportunity to change it.

 Marek

 -- 
 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] Saving Form Data

2003-10-08 Thread Marek Kilimajer
PHP wrote:
Thanks,
I thought of this, unfortuanetly the user uploading the form would have no
clue in being able to build the form with the $_POST tags already in it.

I lost you. What are you trying to do?

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


Re: [PHP] Saving Form Data

2003-10-08 Thread PHP
Here is the real life idea:
A Supervisor, knows nothing about php, creates a simple form, say a time
sheet, in something like FrontPage.
He then uploads that form to the server.
An employee then looks at a page on the server that will retrieve the form
data that the supervisor made, and automatically fill in the form action and
submit buttons.
The employee then fills out the time sheet and submits it.

Easy to do so far, the hard part:
The supervisor can now get the form data that was filled out. BUT, he sees
the data in the same form he created but pre-filled with all the employees
data.
I know it would be easy to simple print out a list of all the form values
and fields like:
Hours = 5
Day 1 Week 1 = 2
Day 2 Week 1 = 1

But it doesn't look as nice as the looking at the same form but with the
values pre-filled in.

Now, I can do this easily enough with and input type=Text fields and
textarea fields. The hard but is the multiple choice type form fields,
like selects.

I think I need some kind of HTML parser that will break up the supervisors
form, then insert any values need for the form values and then re-display
the form data.


 PHP wrote:
  Thanks,
  I thought of this, unfortuanetly the user uploading the form would have
no
  clue in being able to build the form with the $_POST tags already in it.
 
 

 I lost you. What are you trying to do?

 -- 
 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