每当我在本地 Web 服务器上运行此 php 代码时,都会出现错误:
<?php
@ require_once ('C:\wamp\www\Connections\koneksi.php');
session_start();
if (!isset($_SESSION['id']))
{
header("Location:index.php");
}
$sql = "SELECT * FROM pasien WHERE noreg = 1122312131";
$query = mysql_query($sql) or die(mysql_error());
$data2 = mysql_fetch_array($query);
?>
<form id="form1" name="form1" method="post" action="#">
<table width="804" border="0" id="inputdata" style="border-collapse:collapse">
<tr>
<th width="8" rowspan="3" bgcolor="#CCCCCC" scope="row"> </th>
<th width="104" height="50" bgcolor="#CCCCCC" scope="row"><div align="right">Kode Pasien</div></th>
<td width="250" bgcolor="#CCCCCC"><label for="nama"></label>
<label for="noreg"></label>
<div align="left">
<input name="noreg" type="text" id="noreg" size="15" maxlength="13">
<input type="submit" name="view" id="view" value="View"> <?php
@ include_once ('database.php');
$view = $_POST['view'];
$noreg = $_POST['noreg'];
if($view){
$_POST[$noreg];
}
?>
这是错误:
( ! ) Notice: Undefined index: view in C:\wamp\www\somygms\a.php on line 139
和
( ! ) Notice: Undefined index: noreg in C:\wamp\www\somygms\a.php on line 140
感谢您的帮助,将不胜感激。
-行政