表单在1和1主机上工作但不在正确的主机上工作

时间:2011-12-04 01:23:15

标签: php html forms http http-status-code-405

我有一个我在asp页面中创建的表单,这提交到一个php页面。当我在我的主机上测试它时,这是有效的,这不是我想要的文件。我将它添加到1and1主机,因为这是我经常使用它来测试它。

我需要在我的unhost网站上托管在fasthost上,问题是当我按下发送时收到此错误:

405 - HTTP verb used to access this page is not allowed.
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

我不明白这在1和1上有效当我在那里上传文件时,为什么这不适用于fasthost?

我非常感谢任何答案。

由于

编辑: 我搜索并搜索过并找到了帮助文件。 这个问题似乎与实际主机有关,并将-f添加到php文件中。我仍然没有这个工作,但会感谢任何帮助。我看到的页面是http://www.fasthosts.co.uk/knowledge-base/?article_id=70

我已经编辑了php文件,这不起作用的PHP代码是:

 <?php


$name= $_POST['frmName'];
$email_from = $_POST['frmEmail'];
$field_phone = $_POST['frmPhone'];
$field_address = $_POST['frmAddress'];
$field_referral = $_POST['frmReferral'];
$field_frmCallback = $_POST['frmCallback'];
$field_frmEnquiry = $_POST['frmEnquiry'];

$email_to = 'info@moroccanpropertiesltd.com';


$body_message = 'From: '.$name."\n";
$body_message .= 'E-mail: '.$email_from."\n";
$body_message .= 'Phone: '.$field_phone."\n";
$body_message .= 'Address: '.$field_address."\n";
$body_message .= 'Referral: '.$field_referral."\n";
$body_message .= 'Callback: '.$field_frmCallback."\n";
$body_message .= 'Enquiry: '.$field_frmEnquiry;

$headers = "MIME-Version: 1.0\r\n";
$headers = 'From: '.$frmEmail."\r\n";
$subject = "Moroccan Properties Customer";


 $headers .= "Content-Type: multipart/alternative;boundary=" . $boundary . "\r\n";


$message = "This is a MIME encoded message."; 

 $message .= "\r\n\r\n--" . $boundary . "\r\n";
 $message .= "Content-type: text/plain;charset=utf-8\r\n\r\n";
 $message .= "This is the text/plain version.";

 $message .= "\r\n\r\n--" . $boundary . "\r\n";
 $message .= "Content-type: text/html;charset=utf-8\r\n\r\n";
 $message .= "This is the <b>text/html</b> version.";

 $message .= "\r\n\r\n--" . $boundary . "--";

 ini_set("sendmail_from", "info@moroccanpropertiesltd.com");

$mail_status = mail($email_to, $subject, $body_message, $headers, "-finfo@moroccanpropertiesltd.com");

if ($mail_status) { ?>
    <script language="javascript" type="text/javascript">
        alert('Thank you for the message. We will contact you shortly.');
        window.location = 'http://www.moroccanpropertiesltd.com/contact.asp';
    </script>
<?php
}
else { ?>
    <script language="javascript" type="text/javascript">
        alert('Message failed. Please, send an email to info@moroccanpropertiesltd.com');
        window.location = 'url';
    </script>
<?php
}
?>

如果有人能够指出我做错了什么,我将非常感激。

由于

2 个答案:

答案 0 :(得分:0)

听起来您的托管未设置为托管.php页面?您是否尝试过使用.asp版本?通常你不会混合两种脚本语言。

答案 1 :(得分:0)

您必须使用Fasthosts启用脚本,它在网站下的控制面板中,可以选择不同版本的PHP,以及ASP等。