谁帮我看看php代码,谁会~~~

来源:百度知道 编辑:UC知道 时间:2024/06/07 19:44:47
问一下,我做的会员注册页编码如下:
<?php
//初始化session
session_start();
// 包含数据库连接文件和头文件
require ('dbconnect.php');
include('head.php');
?>
<?
if(!isset($_SESSION['username'])) {
echo "<p align=center>";
echo "<font color=#FF0000 size=5><strong><big>";
echo "对不起,您无权查看此页!";
echo "</big></strong></font></p>";
exit();
}
$id=$_GET['id'];
echo "<table align=center><tr><td ><font color=red>注册成功!</font></td></tr>";
echo "<tr><td >下面是你的注册资料:</td></tr>";
// 取得注册资料
$sql="select * from yhzc where id='$id'";
$re=mysql_query($sql,$conn);
$result=mysql_fetch_array($re);
?>
<tr>
<td>用户名:</td>
<td>

因为你的php.ini中配置的是
error_reporting = E_ALL
这样php对变量的检测比较严格。使用变量之前要先声明。。

你可以打开php.ini将其改为
error_reporting = E_ALL & ~E_NOTICE
重启apache或iis
这样就可以将你的警告提示去掉了。