处理HTML表单的PHP返回503错误

时间:2015-04-22 06:03:54

标签: php html forms apache

在我的网站上我使用表格让用户直接通过网站发送内容。为此我使用这个PHP代码进行处理,命名为“sendform.php”:

<?php
    $body = 'Online-Anfrage';
    $body .= '\r\n NAME:';
    $body .= $_POST["input_name"];
    $body .= '\r\n EMAIL:';
    $body .= $_POST["input_email"];
    $body .= '\r\n TELEFON:';
    $body .= $_POST["input_telefon"];
    $body .= '\r\n FAHRZEUG:';
    $body .= $_POST["input_fahrzeug"];
    $body .= '\r\n ERSTZULASSUNG:';
    $body .= $_POST["input_erstzulassung"];
    $body .= '\r\n KILOMETERSTAND:';
    $body .= $_POST["input_kilometerstand"];
    $body .= '\r\n PREISVORSTELLUNG:';
    $body .= $_POST["input_preisvorstellung"];

    $to = "my@mail.de";
    $headers = 'From: info@mmymail.de' . "\r\n" .
    'Reply-To: ' . $_POST["input_email"] . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
    $subject = "Online-Anfrage";
    if (mail($to, $subject, $body, $headers)) 
    {
        echo("<p>Wir haben Ihre Anfrage erhalten. Vielen Dank für Ihr vertrauen!    </p>");  
    } 
    else 
    {
        echo("<p>Interner Serverfehler. Bitte rufen Sie uns für eine Anfrage direkt an:</p>");
    }
?>

但是当我尝试在我的index.html中使用action =“sendform.php”时,我得到一个服务器错误503.我使用的表单的代码就是这个:

                <form class="form-horizontal" method="post" action="sendform.php">
                    <fieldset>

                    <!-- Form Name -->
                    <legend>Kostenlose und unverbindliche Verkaufsanfrage</legend>

                    <!-- Text input-->
                    <div class="form-group">
                      <label class="col-md-4 control-label" for="input_name">Name</label>  
                      <div class="col-md-6">
                      <input id="input_name" name="input_name" type="text" placeholder="" class="form-control input-md" required="">

                      </div>
                    </div>

                    <!-- Text input-->
                    <div class="form-group">
                      <label class="col-md-4 control-label" for="input_email">E-Mail Adresse</label>  
                      <div class="col-md-6">
                      <input id="input_email" name="input_email" type="text" placeholder="" class="form-control input-md" required="">

                      </div>
                    </div>

                    <!-- Text input-->
                    <div class="form-group">
                      <label class="col-md-4 control-label" for="input_telefon">Telefonnummer</label>  
                      <div class="col-md-6">
                      <input id="input_telefon" name="input_telefon" type="text" placeholder="" class="form-control input-md" required="">

                      </div>
                    </div>

                    <!-- Text input-->
                    <div class="form-group">
                      <label class="col-md-4 control-label" for="input_fahrzeug">Fahrzeugmodell</label>  
                      <div class="col-md-6">
                      <input id="input_fahrzeug" name="input_fahrzeug" type="text" placeholder="" class="form-control input-md" required="">

                      </div>
                    </div>

                    <!-- Text input-->
                    <div class="form-group">
                      <label class="col-md-4 control-label" for="input_erstzulassung">Erstzulassung</label>  
                      <div class="col-md-6">
                      <input id="input_erstzulassung" name="input_erstzulassung" type="text" placeholder="" class="form-control input-md" required="">
                      <span class="help-block">Bitte Monat und Jahr angeben.</span>  
                      </div>
                    </div>

                    <!-- Appended Input-->
                    <div class="form-group">
                      <label class="col-md-4 control-label" for="input_kilometerstand">Kilometerstand</label>
                      <div class="col-md-6">
                        <div class="input-group">
                          <input id="input_kilometerstand" name="input_kilometerstand" class="form-control" placeholder="" type="text" required="">
                          <span class="input-group-addon">km</span>
                        </div>

                      </div>
                    </div>
                    <!-- Appended Input-->
                    <div class="form-group">
                      <label class="col-md-4 control-label" for="input_preisvorstellung">Preisvorstellung</label>
                      <div class="col-md-6">
                        <div class="input-group">
                          <input id="input_preisvorstellung" name="input_preisvorstellung" class="form-control" placeholder="" type="text" required="">
                          <span class="input-group-addon">€</span>
                        </div>

                      </div>
                    </div>
                    <button type="submit" class="btn btn-success col-md-12">Anfrage absenden!</button>

                    </fieldset>
                    </form>

我完全不知道如何解决这个问题,因为我无法在namings中找到任何错误,因此必然会有其他原因导致此错误。

服务器日志没有说“解析错误”等等,当变量出现问题时你会得到什么......

编辑:我确实收到了电子邮件,但它们只填充了静态文本,我收到的邮件中不存在变量

你可以帮我这个吗?谢谢!

1 个答案:

答案 0 :(得分:0)

由于服务器临时过载或维护,Web服务器(运行Web站点)当前无法处理HTTP请求。这意味着这是一个暂时的条件,经过一段时间的延迟后会得到缓解。处于此状态的某些服务器也可能只是拒绝套接字连接,在这种情况下,可能会生成不同的错误,因为套接字创建超时。

click here for details and how to remove

and also this