что то не работает форма(((
после нажатия пишет
Method Not Allowed
The requested method POST is not allowed for the URL /xxx.htm.
--------------------------------------------------------------------------------
Apache/1.3.33 Server at
xxx.com Port 80
------------------------------------------------------
<?php
$namemax=52;
$mailmax=20;
$messmax=3250;
?>
<?php
if (getenv('HTTP_X_FORWARDED_FOR'))
{
$ip=getenv('HTTP_X_FORWARDED_FOR');
}
{
$ip=getenv('REMOTE_ADDR');
}
?>
<?php
// E-mail на который будет отсылаться почта.
$mailto="english@russian.ru";
?>
<?php
function display_form() {
?>
<?php
?>
<form name="form1" method="post" action="">
<table width="27%" border="0">
<tr>
<td>
<p><font size="-1">Your company name: </font><br>
<input style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; FONT-FAMILY: "Verdana"; FONT-SIZE: 8pt" type="text" name="im">
</p>
</td>
</tr>
</table>
<table width="27%" border="0">
<tr>
<td>
<p><font size="-1">Your E-Mail: </font> <br>
<input style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; FONT-FAMILY: "Verdana"; FONT-SIZE: 8pt" type="text" name="mail">
</p>
</td>
</tr>
</table>
<table width="27%" border="0">
<tr>
<td>
<p><font size="-1">Your message: </font>
<textarea style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; FONT-FAMILY: "Verdana"; FONT-SIZE: 8pt"class=form cols=80 rows=10 name="mess">
</textarea>
</p>
</td>
</tr>
</table>
<p align="left">
<input style="BACKGROUND-COLOR: #cccccc; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; COLOR: #000000; FONT-FAMILY: verdana; FONT-SIZE: 12px"
type="submit" name="ok" value="SEND">
</p>
</form>
<?php
}
?>
<?php
function process_form() {
global $im, $mail, $mess, $mailto, $namemax, $mailmax, $messmax, $ip;
if (empty($mail) and empty($mess)){echo "All the fields are empty<br>.";exit;}
if(!preg_match("/^([a-z,0-9])+\@([a-z,0-9])+(\.([a-z,0-9])+)+$/", $mail))
{
echo "The field is not correct: <b>Your E-mail</b><br>.";exit;
}
if (empty($mess))
{
echo "The field is empty: <b>Your massage</b><br>.";exit;
}
//$bannedemail=array("baka@me.com","a@cmail.ru","g@cook.ru","none@none.ru");
//for ($i=0; $i<count($bannedemail);$i++){
//if ($mailto == $bannedemail[$i]){echo "Почтовый ящик заблокирован.<br>";
exit;}}
$mess=substr($mess,0,$messmax);
$mail=substr($mail,0,$mailmax);
$im=substr($im,0,$namemax);
// $mess=trim($mess);
// $mail=trim($mail);
// $im=trim($im);
$subject="Вопрос от $mail";
if ($im == ""){$im="none";}
$body="Имя:\n$im\n\nE-mail:\n$mail\n\nКомментарии:\n$mess\n\nIP Logging: $ip\n\nk.";
$body=convert_cyr_string (stripslashes($body),w,k);
$subject=convert_cyr_string (stripslashes($subject),w,k);
$headers = "From: $im <$mail> <$ip>\n";
$headers .= "";
$suck = mail($mailto, $subject, $body, $headers);
if ($suck)
{
echo "Thank you. Your massage is sent.<br><br>";
}
?><?php
}
?>
<?php
if (empty($ok)) { display_form(); } else
{ process_form(); }
?>