Formmail.php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lisamarie_tt
Forum Commoner
Posts: 32
Joined: Fri Jul 15, 2005 8:20 am

Formmail.php

Post 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.
mickd
Forum Contributor
Posts: 397
Joined: Tue Jun 21, 2005 9:05 am
Location: Australia

Post 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)
lisamarie_tt
Forum Commoner
Posts: 32
Joined: Fri Jul 15, 2005 8:20 am

Post 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.
br5dy
Forum Newbie
Posts: 22
Joined: Sat Jul 23, 2005 2:52 pm

Post 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.
Post Reply