Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Need Help With An Emailform
green fairy
post Jun 28 2005, 08:08 PM
Post #1


Newbie [Level 3]
***

Group: Members
Posts: 45
Joined: 18-June 05
From: Norway
Member No.: 8,410



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>
Go to the top of the page
 
+Quote Post
beeseven
post Jun 28 2005, 10:25 PM
Post #2


Privileged Member
*********

Group: Members
Posts: 629
Joined: 26-February 05
Member No.: 3,995



What exactly do you mean it doesn't work?

Do you get an error or does it just not send?
Go to the top of the page
 
+Quote Post
Kubi
post Jun 28 2005, 10:29 PM
Post #3


To Cool for Cache
Group Icon

Group: [MODERATOR]
Posts: 1,123
Joined: 16-June 05
From: Some Place.
Member No.: 8,317
T17 GFX Crew



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.
Go to the top of the page
 
+Quote Post
snlildude87
post Jun 28 2005, 11:07 PM
Post #4


Moderator
***************

Group: Members
Posts: 2,325
Joined: 8-March 05
From: Mawson, Antarctica
Member No.: 4,254



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".
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics


 



- Lo-Fi Version Time is now: 11th October 2008 - 07:34 AM