Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
PHP Contact Form
Hey people, happy new year and all that jizazz fo real.
Anyone got a nifty little web based contact form that just sends an email to an address you specify in the code itself, that they might wanna kinda send to me to use?
Thanks :D
0
This discussion has been closed.
Comments
Make yourself a html form for a start. I'm sure some other kind bean round here will help you out with the php much better than i could have anyway. Check out http://uk.php.net/manual/en/ref.mail.php for reference just incase you get bored :P
Well, here is my take on the subject that I did some time ago, but as you might have guessed, it's not about the script or how easy or hard it is to write, it is about knowing how things work to make it secure and safe to use on a public site.
Use it with caution.
<?php $name = $_POST["name"]; $email = $_POST["email"]; $subject = $_POST["subject"]; $message = $_POST["message"]; $iprotocol = $_SERVER['REMOTE_ADDR']; $useragent = $_SERVER["HTTP_USER_AGENT"]; $mymail = "email@domain.com"; $mail = (" $subject - sitename --------------------------------------------------------------------- Name: $name \n Email: $email \n Message: $message \n\n User Information. --------------------------------------------------------------------- \n IP Address: $iprotocol \n User-Agent: $useragent \n "); mail( $mymail, "$subject - sitename", $mail, "From: $email" ); ?>
For the record, I have no idea how to send emails in PHP.
Like you can see that only things that are not variables are the mail(); function presented below, and the global variables pulled from the server (sent by the html form and the server itself.)
And because of this, it has me believing that it is insecure to use this, too easy to crack open and mess around I believe.
mail( $mymail, "$subject - sitename", $mail, "From: $email" );
You won't learn anything is someone does it for you. You need to make a mistake or 50 to learn.
You won't learn anything is someone does it for you. You need to make a mistake or 50 to learn.
True not always.