hello everyone,
im new here, i want to end up my problem in PHP mail forms, im new in PHP, i used to have an ASP mail forms and was easy to use and i done it well, but i have a project which it needs to be in a PHP format. I already got a PHP script to send mail forms in my contact/feedback form, but the problem is it didnt work. Theres a lot of shared scripts i already used in my site but still it didnt work, the problem again was i dont recieve the mail that i send in the mail i specified in the script. i have this problem a month now.
i have 3 inputs in the form, His/Her Name, Email Address and his/her message.
the recipient email was hidden in the script. then also im having problem in redirection to a THANKS page. ? ?
Can anyone help me solve my problem?
by the way heres the PHP code:contact.php
[CODE]
<?php
global $name;
if($name) {
$name=$_GET[‘name’];
$email=$_GET[’email’];
$subject1=$_GET[‘subject’];
$message=$_GET[‘message’];
$ip=$_SERVER[“REMOTE_ADDR”];
$host = gethostbyaddr($_SERVER[‘REMOTE_ADDR’]);
$host = $ip.”.”.$host;
$mon=date(m);
$day=date(j);
$year=date(y);
$hour=date(g);
$min=date(i);
$sec=date(s);
$hour=$hour-2;
if($hour<=0) { $hour+=12; }
$ts = “$hour:$min:$sec on $mon/$day/$year”;
$to=”[email protected]”;
$subject=”Contact Form:”.” $subject1″;
$body=”
Message from: $name
Subject: $subject1
E-mail: $email
Message: $message
Host: $host
Time: $ts”;
mail($to, $subject, $body);
echo “<script>location.href=”http://mysite.com/thanks.php”</script>”;
}
?>
and heres the HTML code: contact.php
[CODE]
<html>
<head>
<title>Contact Us</title>
</head>
<body bgcolor=”#ffffff” text=”#666666″>
<font face=”verdana” size=”1″>
<form method=”post” action=”contact.php”>
Your Name:<br>
<input type=”text” name=”name” style=”border: 1px solid #cccccc; background-color: #ffffff;”><br><br>
Your E-mail Address:<br>
<input type=”text” name=”email” style=”border: 1px solid #cccccc; background-color: #ffffff;”><br><br>
Subject:<br>
<input type=”text” name=”subject” style=”border: 1px solid #cccccc; background-color: #ffffff;”><br><br>
Message:<br>
<textarea name=”message” cols=”40″ rows=”10″ style=”border: 1px solid #cccccc; background-color: #ffffff;”></textarea>
<br><br>
<input type=”submit” value=”send” style=”border: 1px solid #cccccc; background-color: #ffffff;”>
</form>
</font>
</body>
</html>
i used this because this was the one that easy to understand and the flow are simple. i have different code that i use to
upload in the server but it was all the same, it didnt send an email to the email i specified. and the codes are just the
same, some other codes needs referers and i dont know what does suppose to do.
thanks in advance…