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
}
?>
誰かが私が間違ったことを指摘できれば、非常に感謝しています。
ありがとう