提交表单时出现500内部服务器错误

时间:2016-06-21 06:35:55

标签: php

当我在网上点击提交表格时,我有一个简单的表格,我们有内部错误500,但在提交表格后我有更新的数据。

它在本地运作良好,但在线提交表格也有同样的问题。

我在这里添加了我的代码,

<form action="purchase.php" method="post">
<div class="row">

        <div class="col-md-2">
            Medicine name :
        </div>

        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" name="productName" placeholder="" required>
            </div>
        </div>
    </div>
    <br />
    <div class="row">

        <div class="col-md-2">
            Brand Name :
        </div>

        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" name="brandName" placeholder="" required>
            </div>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-md-2">
            Medicine Strenght :
        </div>
        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" name="productPow" placeholder="" required>
            </div>
        </div>
    </div>
    <br />
    <div class="row">

        <div class="col-md-2">
            Medicine Form :
        </div>

        <div class="col-md-4">
            <div class="input-field">
               <select name="productType" class="form-control" onchange='Check(this.value);'>
               <option id="txt1">Capsule</option>
               <option id="txt1">Tablet</option>
               <option id="txt1">Syrup</option>
               <option id="txt1">Injection</option>
               <option id="txt1">Ointment</option>
               <option id="txt1">Cream</option>
               <option id="txt1">Gel</option>
               <option id="txt1">Lotion</option>
               <option id="txt1">Shampoo</option>
               <option id="txt1">Susp</option>
               <option id="txt1">Liniment</option>
               <option id="txt1">Bar</option>
               <option id="txt1">Soap</option>
               <option id="txt1">FaceWash</option>
               <option id="txt1">Oil</option>
               <option id="txt1">Powder</option>
               <option id="others">others</option>
               </select>

            </div>
        </div>
        <div class="col-md-3">
           <input type="text" class="form-control" name="productType1" id="txt" style="display:none;">
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-md-2">
            Product Company :
        </div>
        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" name="productCom" placeholder="" required>
            </div>
        </div>
    </div>
    <br />
   <div class="row">
        <div class="col-md-2">
            Batch No :
        </div>
        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" name="batch" placeholder="" required>
            </div>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-md-2">
            Manufacturing Date :
        </div>
        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" id="start" name="productMdate" placeholder="mm/yyyy" required>
            </div>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-md-2">
            Expiry Date :
        </div>
        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" id="end" name="productEdate" placeholder="mm/yyyy" required>
            </div>
        </div>
    </div>
    <br />
     <div class="row">
        <div class="col-md-2">
            Quantity :
        </div>
        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" name="productQty" id="productQty" placeholder="" required>
            </div>
        </div>
    </div>
    <br />
     <div class="row">
        <div class="col-md-2">
            MRP :
        </div>
        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" name="productMRP" placeholder="" required>
            </div>
        </div>
    </div>

    <br />
    <div class="row">
        <div class="col-md-2">
            Price Per Quantity :
        </div>
        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" name="PQty" placeholder="" required>
            </div>
        </div>
    </div>

    <br />
    <div class="row">
        <div class="col-md-2">
            Actual Price :
        </div>
        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" name="productAPrice" id="productAPrice" placeholder="" required>
            </div>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-md-2">
            VAT :
        </div>
        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" name="productVAT" id="productVAT" onkeyup="purchasecal();">
            </div>
        </div>
    </div>
    <br />
   <div class="row">
        <div class="col-md-2">
            Price :
        </div>
        <div class="col-md-4">
            <div class="input-field">
               <input type="text" class="form-control" name="productPrice" id="productPrice" placeholder="" required>
            </div>
        </div>
    </div>
    <div class="row">
    <div class="col-md-12">
    <input type="submit" class="btn btn-blue pull-right" value="SUBMIT" name="msg-submit"><br />

    </div>
    </div>
    </form>
    <div class="row">
    <div class="col-lg-12 col-md-12 col-sm-12">
    <!--<iframe name="viewside" src="purchase_entry.php" width="100%"  
        height="700px" frameBorder="0"> 
    </iframe>-->
    </div> 
    </div>
</div>
</section>
<?php
include_once('connect_db.php');
if(isset($_POST['msg-submit'])){
$productName=$_POST['productName'];
$brandName=$_POST['brandName'];
$productPow=$_POST['productPow'];

$productType=$_POST['productType'];

$productCom=$_POST['productCom'];
$batch=$_POST['batch'];
$productMdate=$_POST['productMdate'];
$productEdate=$_POST['productEdate'];
$productQty=$_POST['productQty'];
$productPrice=$_POST['productPrice'];
$PQty=$_POST['PQty'];
$productAPrice=$_POST['productAPrice'];
$productVAT=$_POST['productVAT'];
$productMRP=$_POST['productMRP'];


$sql="INSERT INTO xxx (product_name, product_brand, product_power, product_type, product_Com, batch_no, manufacturing_date, expiry_date, quantity, price, ppq, actual_price, vat, mrp, Purchase_Date, Stock_Count) VALUES ( '$productName','$brandName', '$productPow', '$productType', '$productCom', '$batch', '$productMdate', '$productEdate', '$productQty', '$productPrice', '$PQty', '$productAPrice', '$productVAT', '$productMRP', DATE_FORMAT(NOW(),'%d/%m/%Y'), '$productQty')";
mysql_query($sql);
}

1 个答案:

答案 0 :(得分:0)

我认为您的服务器配置不匹配 - 取决于您使用PHP运行的服务器作为fpm或fcgi - &gt;您可能需要更改一个指令:

FcgidMaxRequestLen 131072

这是默认值 - &gt; 128kB并不多。所以也许你超过了最大请求长度。