我有一个在 asp 页面中创建的表单,它提交到 php 页面。当我在我不想要文件的主机中测试它时,这是有效的。我将它添加到 1and1 主机,因为这是我更频繁地使用它来测试它。
我需要它用于托管在 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.
我不明白这在 1and1 上有效,为什么当我在那里上传文件时这在 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
}
?>
如果有人能指出我做错了什么,我将不胜感激。
谢谢