Basic Scripting Help

Hey all. I’m not a PHP guy - I’m mainly front-end. My client wants me to create a simple form - a name, email address, and message.

Does anyone have a script handy or know a site where I can get the php code to send an email (or create a log on the server) w/ the user’s name, email address, and message upon submitting it?

Thanks a lot in advance.

Here is a basic one. No user input has been sanitized though. You’ll need to add security to it now. Never trust user input.

HTML to match. Here is the example HTML for $email.

<input type="text" [b]name="email"[/b] value="Email" />
$name =$_POST['name'];
$message = $_POST['message'];
$subject = $_POST['subject'];
$from = "";

$send = mail($from , $subject , "Someone wants to contact you through your website.\
The user who wants to is. \
User: ".$name."\
Email: ".$email."\
Your welcome", "FROM:");

if ($send||isset($send)||!empty($send))
} else if(!$send||empty($send)||!isset($send)) {

You’ll need to setup an email account with your domain. Make sure it matches what is put in the script :).

Is it really working script, i am gonna give it try. Thanks for your efforts.

Does it have to be an email account w/ that domain? Or can I just use my gmail or yahoo?


Edit: Thanks, by the way.

Must be with that domain. Well, I assume so. You have to use an account linked to the domain. I don’t know what your host provides in terms of that :). I just made an account there. Had it be “donotrespond” etc…

Alright. Thanks a lot.


No problem :). Glad to help.