Forum Moderators: coopster

Message Too Old, No Replies

PHP script to email form variables

         

charger9

6:59 pm on Feb 12, 2008 (gmt 0)

10+ Year Member



I have a multi-page form that uses php variables to pass the information. I want to submit this form via email, but I've relied on this site and a few others to copy code and make it work, I really don't know php or perl. I have used a formmail.pl file in past simple forms, but I've found that doesn't work in this case.

Can someone point me in the right direction? Maybe a short sample php script?

Thanks in advance!

jatar_k

7:07 pm on Feb 12, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



if it is a multipage form then you're probably going to have to resort to sessions or cookies to store the info from previous forms.

At the end you would get all the session info plus any added POST data and shoot it into an email.

how many parts are there to the form?
can you make it a single form?

charger9

7:14 pm on Feb 12, 2008 (gmt 0)

10+ Year Member



I've got the form storing the variables in a session. There are over 140 variables I'm looking to send, so a single form is not an option.

Do I need to put all of the form variables on the last page before it submits? How to I shoot it into an email?

jatar_k

9:08 pm on Feb 12, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



if you have it all in a session then you need to append to the body of the email

you could loop through the session and add variable name/value to the body of the email with a newline at the end to start

ugly but straight forward