简体   繁体   English

简单的PHP表单不起作用-500内部服务器错误-Parallels Plesk Panel 9.5

[英]Simple PHP Form Not Working - 500 Internal Server Error - Parallels Plesk Panel 9.5

I'm stumped why this contact form returns a 500 Internal Server Error. 我很困惑为什么此联系表返回500 Internal Server Error。 I am 99% sure that my code is immaculate. 我99%确信我的代码是完美无缺的。

I am using Parallels Plesk Panel 9.5 as my hosting admin control panel. 我使用Parallels Plesk Panel 9.5作为托管管理控制台。 I have found Log Manager, and checked in both Access Logs and Error Logs. 我找到了日志管理器,并检入了访问日志和错误日志。 In Error Logs there are entries for [error] [client 162.247.90.74], [error] [client 184.164.146.26] which say file doesn't exist, and [error] [client 216.21.233.2] which says cannot create or spawn child process. 在错误日志中,有[错误] [客户端162.247.90.74],[错误] [客户端184.164.146.26]和[错误] [客户端216.21.233.2]的条目,它们表示无法创建或产生子进程。

My HTML form on contact.html: 我在contact.html上的HTML表单:

 <form class="form-horizontal" method="post" action="mailer.php" class="form-horizontal" role="form">
    <div class="form-group">
        <label for="name" class="col-sm-2"><small>Name</small></label>
           <div class="col-sm-10">
              <input type="text" class="form-control" id="inputName" name="inputName" placeholder="Enter your full name" required>
           </div>
     </div>
    <div class="form-group">
        <label for="email" class="col-sm-2"><small>Email</small></label>
            <div class="col-sm-10">
                <input type="email" class="form-control" id="inputEmail" name="inputEmail" placeholder="Enter your email, example@domain.com" required>
            </div>
    </div>
    <div class="form-group">
        <label for="name" class="col-sm-2"><small>Telephone</small></label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputPhone" name="inputPhone" placeholder="Enter your telephone number" required>
            </div>
    </div>
    <div class="form-group">
        <label for="message" class="col-sm-2"><small>Message</small></label>
            <div class="col-sm-10">
                <textarea class="form-control" rows="4" name="inputMessage" id="inputMessage" placeholder="Enter your message here" required></textarea>
            </div>
    </div>
    <div class="form-group">
        <p class="antispam">Leave this empty:
        <br /><input name="url" /></p>
    </div>
    <div class="form-group">
        <div class="col-sm-10 col-sm-offset-2">
            <input style="font-size:22px;" id="submit" name="submit" type="submit" value="Send" class="btn">
        </div>
    </div>
</form>

The mailer.php document: mailer.php文件:

 <?php

 // if the url field is empty
 if(isset($_POST['url']) && $_POST['url'] == ''){

// then send the form to your email
mail( 'info@website.com', 'Contact Form', print_r($_POST,true) );
}

// otherwise, let the spammer think that they got their message through

// redirect to thank you page

header('Location: http://www.website.com/thankyou.html');
exit('Redirecting you to http://www.website.com/thankyou.html');

?>

I called my hosting provider and harassed them some more. 我打电话给托管服务提供商,并对他们进行了进一步骚扰。 They said that the account was "holding memory" so they refreshed it and now it works. 他们说该帐户正在“保存内存”,因此他们刷新了它,现在可以使用了。 Well, I guess that's the answer! 好吧,我想这就是答案!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM