|
27.09.2010, 14:26
Добрый день!!!!
Сайт работает коректно http://www.kafe-technic.ru/ и вот всётаки потребовалась она эта форма.
по орме как не пробовал она работать не хочет ошибку выдааёт т.е. страница не грузица. подскажите как прописать чтобы соответвовать требованиям хостера?
Вот код этой формы
PHP код:
if (!isset($opi) OR ($opi != "ds")) {
$intcookie = intval($cookie[0]);
if (!empty($cookie[1])) {
$sql = "SELECT name, username, user_email FROM ".$user_prefix."_users WHERE user_id='".$intcookie."'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!empty($row['name'])) {
$sender_name = filter($row['name'], "nohtml");
} else {
$sender_name = filter($row['username'], "nohtml");
}
$sender_email = filter($row['user_email'], "nohtml");
} else {
$sender_email = "";
$sender_name = "";
}
}
if (!isset($message)) { $message = ""; }
if (!isset($opi)) { $opi = ""; }
if (!isset($send)) { $send = ""; }
info_box("note", _FEEDBACKNOTE);
echo "<br>";
$form_block = "
<table border=\"0\" width=\"100%\">
<tr><td nowrap><FORM METHOD=\"post\" ACTION=\"modules.php?name=$module_name\">
<strong>"._YOURNAME.":</strong></td><td><INPUT type=\"text\" NAME=\"sender_name\" VALUE=\"$sender_name\" SIZE=30></td></tr>
<tr><td nowrap><strong>"._YOUREMAIL.":</strong></td><td><INPUT type=\"text\" NAME=\"sender_email\" VALUE=\"$sender_email\" SIZE=30></td></tr>
<tr><td><strong>"._MESSAGE.":</strong></td><td><TEXTAREA NAME=\"message\" COLS=60 ROWS=10 WRAP=virtual>$message</TEXTAREA><br>
</td></tr>
<tr><td> </td><td><INPUT type=\"hidden\" name=\"opi\" value=\"ds\">
<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\""._SEND."\">
</FORM></td></tr></table>
";
OpenTable();
if ($_POST['opi'] != "ds") {
echo $form_block;
} else {
if (empty($sender_name)) {
$name_err = "<div align=\"center\"><span class=\"option\"><strong><em>"._FBENTERNAME."</em></strong></span></div>";
$send = "no";
}
if (empty($sender_email)) {
$email_err = "<div align=\"center\"><span class=\"option\"><strong><em>"._FBENTEREMAIL."</em></strong></span></div>";
$send = "no";
}
if (empty($message)) {
$message_err = "<div align=\"center\"><span class=\"option\"><strong><em>"._FBENTERMESSAGE."</em></span></font></div>";
$send = "no";
}
if ($send != "no") {
$sender_name = removecrlf(filter($sender_name, "nohtml"));
$sender_email = removecrlf(filter($sender_email, "nohtml"));
$message = filter($message, "nohtml");
$msg = "$sitename\n\n";
$msg .= ""._SENDERNAME.": $sender_name\n";
$msg .= ""._SENDEREMAIL.": $sender_email\n";
$msg .= ""._MESSAGE.": $message\n\n";
$to = $adminmail ;
$mailheaders = "From: $sender_name <$sender_email>\n";
$mailheaders .= "Reply-To: $sender_email\n\n";
mail($to, $subject, $msg, $mailheaders);
echo "<p><div align=\"center\">"._FBMAILSENT."</div></p>";
echo "<p><div align=\"center\">"._FBTHANKSFORCONTACT."</div></p>";
} elseif ($send == "no") {
OpenTable2();
if (!empty($name_err)) { echo "$name_err"; }
if (!empty($email_err)) {echo "$email_err"; }
if (!empty($message_err)) {echo "$message_err"; }
CloseTable2();
echo "<br><br>";
echo $form_block;
}
}
|
|