gpt4 book ai didi

php - 第一次打开时出错,PHP

转载 作者:太空宇宙 更新时间:2023-11-03 12:34:46 27 4
gpt4 key购买 nike

<分区>

当程序直接运行时我收到一条错误消息,但当我单击搜索按钮时它运行正常。

错误信息是 Notice: Undefined index no in [...] on line 21 和 line 21 is $no1 = $_POST['no'];

我该如何解决这个问题?

这是我的完整代码:

<html>
<head>
<title> Searching </title>
</head>
<body>


<form method="POST" action="out.php">
<table border="0" cellpadding="5" cellspacing="0">
<tbody>
<tr>
<td> No </td>
<td>:</td>
<td> <input type="text" name="no"> </td>
<td> <input type="SUBMIT" name="SUBMIT" id="SUBMIT" value="search" >
<?php

include('connect.php');


$no1 = $_POST['no'];
$no = strtoupper($no1);
$query = mysql_query("select no, type, time from park where no = '$no'") or die(mysql_error());
$data = mysql_fetch_array($query);

?>
</td>
</tr>


<tr>
<td>Type</td>
<td>:</td>
<td><input type="text" name="type" maxlength="30" value= "<?php echo $data['type']; ?>" /></td>
</tr>
<tr>
<td>Time</td>
<td>:</td>
<td><input type="text" name="time" maxlength="4" value= "<?php echo $data['time']; ?>" //></td>
</tr>

<tr></tr>

</tbody>
</table>
</form>
</body>
</html>

和截图:

enter image description here

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com