仅在文本框上使用未定义的索引,<select>可以正常工作</select>

时间:2014-09-19 02:54:16

标签: javascript php mysql

  

注意:未定义索引&lt; ----仅在文本框上隐藏

     

似乎我的文本框和隐藏字段中的值未提交但是   选择填充传递

release.php

<form name="process_release"  action="content/process_release.php"  onsubmit="return validateForm()" method="POST">
<div class="col-xs-6 col-md-offset-3" align="center">
<table class="table">
    <caption><h2>Releasing</h2></caption>
    <tr>
        <td><label>Item (Description) :</label></td><td><input type="text" name="Releasing_item" /></td>
    </tr>
    <tr>            
        <td><label>No of Items :</label></td><td><select name="Releasing_pieces" >                                      <option value="1">1</option>
                                    <option value="2">2</option>
                                    <option value="3">3</option>      
                                    </select></td>  
    </tr>
    <tr>
        <td><label>Office :</label></td><td><input type="text" name="Releasing_office" /></td>
    </tr>
    <tr>
        <td><label>Received by :</label></td><td><input type="text" name="Releasing_personnel" /></td>
    </tr>
    <tr>
        <input type="hidden" name="Releasing_pointer" value="Released" />
    </tr>
</table>
    <div>   
        <button type="submit" value="submit" name="send" class="btn btn-success">Submit</button>
        <button type="reset" value="Reset" class="btn btn-default" >Clear</button>
    </div>
</div>

process_release.php

<?php
 include ('../required/connect.php');

 if (isset($_POST['Releasing_item'])){
 $item = $_POST['Releasing_item'];
 $pieces = $_POST['Releasing_pieces'];
 $office = $_POST['Releasing_office'];
 $personnel = $_POST['Releasing_personnel'];
 $pointer = $_POST['Releasing_pointer'];
  $sql = "INSERT INTO tracking (item, pieces, office, personnel, pointer) VALUES ('$item','$pieces','$office','$personnel','$pointer')";

  if (!mysql_query($sql,$con))
    {
    die('Error: ' . mysql_error());
    }
  print "<script type=\"text/javascript\">"; 
  print "alert('Request Successful!')"; 
  print "</script>";

  mysql_close($con);
  echo "<meta http-equiv='refresh' content='1; URL=listings.php'>";
  }
 else
  {
   mysql_close($con);
     print "<script type=\"text/javascript\">"; 
     print "alert('Database Error!')"; 
     print "</script>";
     echo "<meta http-equiv='refresh' content='1; URL=../index.php'>";
      } 

?>
  

注意:未定义索引&lt; ----仅在文本框上隐藏

     

似乎我的文本框和隐藏字段中的值未提交但是   选择填充传递

0 个答案:

没有答案