0

我这里有一些问题,我无法解决它,我想从文本框中获取值并显示它,如果它在 mysql 中可用我目前在做什么:index.php

    <form method="get" action="code.php">
    <input name="code" type="text">
    <input name="Submit" type="submit" value="submit">

</form>

至于我的code.php

<?php
 $con=mysqli_connect("localhost","root","","code");
 // Check connection
 if (mysqli_connect_errno())
   {
   echo "Failed to connect to MySQL: " . mysqli_connect_error();
   }

 $result = mysqli_query($con,"SELECT Code , Status FROM data");


 //while($row = mysqli_fetch_array($result))
   //{
   //echo $row['$_GET ""'] . " " . $row['Status'];
   //echo "<br />";
   //}

if(isset($_GET['Code']))
{
    $Code=$_REQUEST['Code'];
    $Status=$_REQUEST['Status'];

    echo $Code; /* no value is echo */
    echo $Status; /* no value is echo */
}    


 mysqli_close($con);


 ?>
4

1 回答 1

0

发生这种情况是因为区分大小写。你发送的数据名为code,不是Code。此外,您的表单中没有任何字段Status,所以我现在知道您对它有什么期望。

于 2013-04-28T01:11:39.343 回答