我正在运行一个php脚本,它应该在表单提交时发送电子邮件。当我提交表单时,我会收到以下错误。
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error><Code>InvalidArgument</Code><Message>Invalid argument.</Message><Details>Missing file part</Details></Error>这是我的html代码
<html lang="en">
<head>
<script src="email_me.php"></script>
<meta charset="utf-8">
</head>
<section class="contact_us1">
<form action="email_me.php" method="post" role="form" aria-label="contact form" enctype="multipart/form-data">
<div>
<input id="field1" aria-invalid="false" name="Name" value="" placeholder="Name" data-aid="nameField" type="text" required>
<input id="field2" aria-invalid="false" name="Email" value="" placeholder="Email" data-aid="emailField" type="text" required>
<input id="field4" aria-invalid="false" name="Subject" value="" placeholder="Subject" data-aid="subjectField" type="text">
</div>
<textarea name="Message" class="message" placeholder="Message" data-aid="messageField" ></textarea>
<button type="submit" >Send</button>
</form>
</section>这是我的PHP脚本
<?php
if($_POST["submit"]) {
$recipient="my@email.com"; //Enter your mail address
$subject=$_POST["Subject"]; //Subject
$sender=$_POST["Name"];
$senderEmail=$_POST["Email"];
$message=$_POST["Message"];
$mailBody="Name: $sender\nEmail Address: $senderEmail\nSubject:$subject\n\nMessage: $message";
mail($recipient, $subject, $mailBody);
sleep(1);
header("Location:http://www.affordtotrip.com/"); // Set here redirect page or destination page
}
?>我使用google作为服务器,并为此创建了一个桶。提交后,我想要一封电子邮件被发送,并为页面刷新。
更新
不过,我不知道如何将这个php项目链接到实际的html页面。我唯一遇到麻烦的DNS记录是
Custom domain name SSL Security RecordType Data Alias
Google-managed, auto-renewing - CNAME ghs.googlehosted.com www 因为它与此域冲突
Type Name Data TTl
CNAME www c.storage.googleapis.com 600 sec当我将cname记录更改为ghs记录时,会收到以下错误
<Error>
<Code>InvalidArgument</Code>
<Message>Invalid argument.</Message>
<Details>The requested project was not found.</Details>
</Error>很抱歉,这个编辑是如此的混乱,我完全不明白我在google云上做了什么。我在存储桶中有一个项目,在应用程序引擎中有另一个项目,但是我不知道如何在应用程序引擎中显示我的html,或者如何从我的存储桶中执行我的php项目。
这是我在godaddy的DNS设置的图片

我的php桶列表的图片

一张电子邮件桶的照片

和DNS设置的图片-- google云--列在自定义web地址下面。

发布于 2018-03-30 06:29:45
您的服务器不允许执行PHP脚本,并将其呈现为文本。请与您的服务器提供程序检查如何修复此问题。
https://stackoverflow.com/questions/49569382
复制相似问题