Support Forums
PHP form creator? - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21)
+---- Thread: PHP form creator? (/showthread.php?tid=19506)



PHP form creator? - Sam - 06-11-2011

I've made a form in in PHP and I've got a submit button, I'd like to know how I can get that to submit to my Email with all the details they filled out.

Screenshot of form:

[Image: formd.png]

any help would be appreciated, if I could perhaps PM someone the code and they could help getting it to send to email?


RE: PHP form creator? - ★Cooldude★ - 06-11-2011

If you PM me the code I'll have a go at this.


RE: PHP form creator? - 0xE9 - 06-11-2011

Have it post to a page then use mail() with $_POST['variablename'] to send an email.


RE: PHP form creator? - Sam - 06-11-2011

No idea what you're talking about? Give me an example with the field "username"


RE: PHP form creator? - 0xE9 - 06-11-2011

Quick and insecure example.

say your current page's form posts to /lol/noobs.php with their username in the variable with name "usr".

on noobs.php you would have:

<?php
if(isset($_POST['usr']))
{
$variable = $_POST['usr'];
mail('you@you.com', 'HAI DER (subject)', $variable);
}
?>


RE: PHP form creator? - Sam - 06-11-2011

I have it fully working, thanks.


RE: PHP form creator? - Bencori - 07-13-2011

Two easy steps for this:

1) Go to your favorite search engine's site and type: php manual mail()
2) Click on what will most likely be the first link and read the manual about the mail() function

After you have done those two steps, you shouldn't have any problems to do this simple task!


RE: PHP form creator? - Skyset - 07-13-2011

I'm sharing a working contact form over at HF for l33t's and ub3r's. You could request that and take a look at it.

- Skyset