Log in

View Full Version : E-Mail forms



Shotgun Ninja
02-07-2007, 08:11 PM
I need help with an email-based contact form. I am trying to make a form that will format and submit the results to an e-mail address for my website. I would be a noob and use FrontPage, but I can't access it from my current location. Help, cie vou plais?

djr33
02-08-2007, 01:12 AM
Frontpage is bad. Try to avoid it.

Forms are easy. Just google it and look at the various elements.
Using PHP to interpret this you can get the sent values (based on the name="" attribute of each), and then do things with them and finally send the email.

Or just find a free form mailer, and do it that way. But it's not very professional or customizable.

Shotgun Ninja
02-08-2007, 07:09 PM
By the way, I meant a form where other users can send the admin an e-mail.

And yes, I am trying to avoid using FrontPage. But there are a few things on there that are helpful.

djr33
02-08-2007, 10:51 PM
Well... easy enough.
Just use the form you'd like...
<form ...>
<input .....>
...etc....
</form>

Then set the action to a .php page.

In the php page, access it with the post array $_POST['fieldname']

Then make the message (like $_POST['field1']."\n".$_POST['field2'] would add field1 and field2, with a line break between them).

Then use the mail() fuction... lots of info at www.php.net for that.

Shotgun Ninja
02-09-2007, 02:27 PM
...?

Sorry, I'm kinda new to PHP. I briefly checked out the site, but I'm still a little iffy. I've seen PHP code before, but I don't know how to put it together properly. Just like when I was trying to learn C++. Oh well. I'll read up on it and see what I can figure out.