Jul 20, 2008

Need Help With An Emailform

Free Web Hosting, No Ads > General > Hosted Members Area

free web hosting

Need Help With An Emailform

green fairy
I'm quite new to php and I have just made myself an email form what I can't make work for some reason. Could anyone who knows phph perhaps tell me what I am doing wrong?
QUOTE
<html>

<head>
<title>Contact</title>
</head>

<body>

<h1>Contact:</h1>

If you need to contact the webmistress, please use this form (enter all fields):
<form action="sendmail.php" method="post">

<table border=0 cellspacing=3 height="231">
<tr valign=top>


<td height="25">Your name:</td><td height="25"><INPUT type="text" name="name" size="25"></td></tr>
<tr><td height="25">Your email:</td><td height="25"><INPUT type="text" name="email" size="25"></td></tr>
<tr><td height="25">Subject:</td><td height="25"><INPUT type="text" name="subject" size="25"></td></tr>


<tr><td colspan=2 height="130">
<textarea name="message" rows=7 cols=30>Add your questions, comments, suggestions or feedback.</textarea>
</td></tr>
<tr>
<td height="27">

<input type="submit" name="submit" value=" Send ">
</td></tr></table><br>

</form>


<?
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;

if (empty($name) || empty($email) || empty($subject) || empty($message)) {

header ( "Expires: Mon, 20 Des 1998 01:00:00 GTM" );
header ( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GTM" );
header ( "Cache-Control: no-cache, must-revalidate" );
header ( "Pragma: no-cache" );

?>

<h2>Error!</h2>
<p>
Oops, it appears you forgot to enter some fields. Please try again.
</p>

<?
}
else {
mail( "nkf.webmistress@gmail.com", "$subject, $message, "From: $name <$email>" );
?>

<h2>Thank you!</h2>
<p>Your message has now been sent!</p>

<?
}
?>

</body>

</html>

 

 

 


Reply

beeseven
What exactly do you mean it doesn't work?

Do you get an error or does it just not send?

Reply

Kubi
Actually, I have just the thing for you! snlildude wrote this tutorial a while ago.

QUOTE


It's extremely simple, just edit the email "To" fields so it's sent to your email and not his(lol). You can edit the message that the people see once they click "Sumbit" other that that, you shouldn't need to edit anything else.
Hope that helps.

Reply

snlildude87
I was going to suggest my email tutorial. laugh.gif

Anyway, if you're set on using your script, please tell us what's happening so we can figure it out. Also, you can try to edit your script after reading my tutorial, so that it's similar to mine.

I do have one thing to say when I was scanning your script...change all the "$_REQUEST"s to "$_POST".

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : emailform


    Looking for emailform

Searching Video's for emailform
advertisement



Need Help With An Emailform



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE