无法从php中的表单读取输入

时间:2016-09-28 08:37:02

标签: php wampserver

我无法从运行在wamp服务器上的php中的表单中读取输入数据。 以下是代码:

    <?php
    // define variables and set to empty values
    $doctype = $docnbr = $entrydt = $incserno = $incsernodt = $recdfr = $sub = "";

    if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $doctype = test_input($_POST["doctype"]);   
    $docnbr = test_input($_POST["docnbr"]);
    $entrydt = test_input($_POST["entrydt"]);
    $incserno = test_input($_POST["incserno"]);
    $incsernodt = test_input($_POST["incsernodt"]);
    $recdfr = test_input($_POST["recdfr"]);
    $sub = test_input($_POST["sub"]);
    }

   function test_input($data) {
   $data = trim($data);
   $data = stripslashes($data);
   $data = htmlspecialchars($data);
   return $data;
   }
   ?>

    <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" style="margin-bottom:10px; margin-left:10px; margin-right:10px; margin-top:10px">
    <div class="form-group row" style="width:75%">
    <label for="documenttype" class="col-xs-2 col-form-label">Type of Document</label>
    <div class="col-xs-10">
    <select class="form-control" id="documenttype" name="doctype">
    <option selected="selected">Select</option>
    <option>File</option>
    <option>Letter</option>
    </select>
    </div>
    </div>

    <div class="form-group row" style="width:75%">
    <label for="documentnumber" class="col-xs-2 col-form-label">Document Number</label>
    <div class="col-xs-10">
    <input class="form-control" type="text" id="docnumber" name="docnbr" placeholder="<?php echo $max_docno; ?>" readonly>
    </div>
    </div>

    <div class="form-group row" style="width:75%">
    <label for="documententrydate" class="col-xs-2 col-form-label">Entry Date</label> 
    <div class="col-xs-10">   
    <input class="form-control" type='date' id="entrydate" name="entrydt" />
    </div>  
    </div>

    <div class="form-group row" style="width:75%">
    <label for="incomingserno" class="col-xs-2 col-form-label">Incoming Serial Number</label>
    <div class="col-xs-4">
    <input class="form-control" type="text" id="incomingserno" name="incserno">
    </div>
    <label for="indated" class="col-xs-1 col-form-label">Dated</label>
    <div class="col-xs-5">
    <input class="form-control" type="date" id="incomingsernodt" name="incsernodt">
    </div>
    </div>

   <div class="form-group row" style="width:75%">
   <label for="recdfrom" class="col-xs-2 col-form-label">Received From</label>
   <div class="col-xs-10">
   <input class="form-control" type="text" id="recdfrom" name="recdfr">
   </div>
   </div>

   <div class="form-group row" style="width:75%">
   <label for="subject" class="col-xs-2 col-form-label">Subject</label>
   <div class="col-xs-10">
   <textarea class="form-control" id="subject" name="sub"></textarea>
   </div>
   </div>

   <center>
   <input type="submit" name="submit" value="Submit">
   <input type="reset" value="Reset">
   </center>
   </form>

<form menthod="post"更改为<form method="post"

变量中没有捕获任何内容: $doctype$docnbr$entrydt,$ incserno , $ incsernodt , $ recdfr , $ sub . I have also tried using isset()`函数捕获提交按钮的状态而不是检查请求方法,但无济于事,我无法从wamp服务器上的php表单中捕获表单数据。

1 个答案:

答案 0 :(得分:0)

Tou必须从If bIsDimensioned = True Then Set RotationShapeRange = wrdDoc.Shapes.Range(RotationArray) RotationShapeRange.IncrementRotation 90 RotationShapeRange.WrapFormat.Type = wdWrapTight RotationShapeRange.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage RotationShapeRange.RelativeVerticalPosition = wdRelativeVerticalPositionPage RotationShapeRange.Left = wdShapeCenter RotationShapeRange.Top = wdShapeCenter End If 更改 并且还会修改你的变量来查看它。

menthod to method