ماهان مقدم
پنج شنبه 29 اسفند 1387, 20:26 عصر
آقا مشکل این کد من چیه ؟ این اسکریپت کارش باید ارسال ایمیل و ثبت ارسال شدن در کوکی باشه ولی اول در مورد setcookie ایراد میگیره و بعد هم اصلا ایمیلی نمیفرسته.
<html>
<head>
<title></title>
</head>
<body>
<?php
$to = "info@df-team.ir";
$from = "Opinion Sender";
$from_header = "From: $from";
$subject = "Opinion";
$contents = "Pooyan: " . $_POST["P1"] . "Mostafa: " . $_POST["P2"] . "Mojtaba: " . $_POST["P3"] . "Mahan: " . $_POST["P4"];
$Co = $_COOKIE["OP"];
if($Co == "Passed"){
echo("You can't send opinion becuase you passed this action.");
}
else {
if($contents != "")
{
//send mail - $subject & $contents come from surfer input
mail($to, $subject, $contents, $from_header);
// redirect back to url visitor came from
echo("You'r opinion is sent !. Now you can turn to you'r page. Bye !");
}
else
{
print("<HTML><BODY>Error, no comments were submitted!");
print("</BODY></HTML>");
}
}
if($Co != "Passed"){
setcookie("OP", "Passed", time()+3600);
}
?>
</body>
</html>
<html>
<head>
<title></title>
</head>
<body>
<?php
$to = "info@df-team.ir";
$from = "Opinion Sender";
$from_header = "From: $from";
$subject = "Opinion";
$contents = "Pooyan: " . $_POST["P1"] . "Mostafa: " . $_POST["P2"] . "Mojtaba: " . $_POST["P3"] . "Mahan: " . $_POST["P4"];
$Co = $_COOKIE["OP"];
if($Co == "Passed"){
echo("You can't send opinion becuase you passed this action.");
}
else {
if($contents != "")
{
//send mail - $subject & $contents come from surfer input
mail($to, $subject, $contents, $from_header);
// redirect back to url visitor came from
echo("You'r opinion is sent !. Now you can turn to you'r page. Bye !");
}
else
{
print("<HTML><BODY>Error, no comments were submitted!");
print("</BODY></HTML>");
}
}
if($Co != "Passed"){
setcookie("OP", "Passed", time()+3600);
}
?>
</body>
</html>