Problems Posting Form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
webgenius
Forum Newbie
Posts: 12
Joined: Sat Aug 16, 2003 3:29 am
Location: Lagos, Nigeria
Contact:

Problems Posting Form

Post by webgenius »

I'm having problem with my contact form. I wrote this PHP script but it's not sending any message to my mail box when submitted. Can you help me out.

This is the code.


<meta http-equiv="refresh" content="10;URL=thanks.html">
<?
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$email=$_POST['email'];
$telephone=$_POST['telephone'];
$mailling=$_POST['mailling'];
$comments=$_POST['comments'];
$to="clickzone@lycos.co.uk";
$message="Message for ClickZone from $firstname $lastname. The message is:\n$comments\n\n The e-mail address is: $email, the Telephone number is: $telephone, the Mailling address is: $mailling";
if(mail($to,"Comments From Web Genius' Site",$message,"From: $email\n")) {
echo "Your message has been sent to CLICKZONE, thanks for writing. This page will automatically redirect";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>


Thanks.
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

have you configured your mail()-settings?
webgenius
Forum Newbie
Posts: 12
Joined: Sat Aug 16, 2003 3:29 am
Location: Lagos, Nigeria
Contact:

Post by webgenius »

How do I do that
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Is this script running on your own PC or on a host's server? Is it running on Windows or Unix/Linux?

Mac
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

from what i know, you/your host have to be able to handle mail()?
webgenius
Forum Newbie
Posts: 12
Joined: Sat Aug 16, 2003 3:29 am
Location: Lagos, Nigeria
Contact:

Post by webgenius »

the script is running on my host and it's a Unix server.
Post Reply