Page 1 of 1

Formmail.php

Posted: Wed Jul 27, 2005 9:31 am
by lisamarie_tt
Has anyone used the Formmail.php file available at http://www.dtheatre.com/scripts/formmail_doc.php

I need some assistance. I have made modifcations to the file as suggested by the documentation available at the above site and the file sends my inforamtion from the submitting form to an e-mail.

I would however, like to specify what form options to send in the e-mail. For Example if my form is submitting - UserName, Age and Password. I'll like to send in mail only UserName and Age.

Can this be done? If so - What modifications do I need to make to the formmail.php file.

Posted: Wed Jul 27, 2005 9:40 am
by mickd
if its sending username, age, password already, all you need to do is delete the body of the mail()that sets the value of the body with the password variable.

http://au3.php.net/manual/en/function.mail.php

mail($to, $subject, $body, $headers)

Posted: Wed Jul 27, 2005 9:51 am
by lisamarie_tt
>> mickd

I'm a little lame in the php area :(.

I see the mail function that you mentioned, but ....

The content of the e-mail, (I think) is built in a loop therefore I can't access each data part individually.

My next move is to try and test within the loop for the name of the password field and not attach this to the body of the mail, but the code a little confusing to me.

Any other suggestions that may help me out here a little will be greatly appreciated.

Posted: Wed Jul 27, 2005 11:09 am
by br5dy
I used to use formmail. It's a great script.

However, it's just used for mailing. Are you prepared with your username/password script? You'll have to do some redirection which could get a little messy.

I'd recommend making your login script, and at the bottom e-mailing the username and password to yourself using what mickd said.

Code: Select all

mail('lisamarie_tt@yoursite.com', 'User info', $username . ' is ' . $age . ' year old.');
That's just one simple example of sending the email. Give your username, password, and age fields names such as 'username', 'password', and 'age'.

When using the PHP script, just make sure to keep the variables the same as your field names.

Read up a little bit on PHP, it's awesome.