我明明定义了 大神们帮我看一下我的代码哪里出错啊!下面是代码 和错误信息!
错误信息:(!)Notice:Undefinedvariable:nameinE:\directory\ceshi\lianjie.phponline4CallStack...
错误信息:
( ! ) Notice: Undefined variable: name in E:\directory\ceshi\lianjie.php on line 4
Call Stack
# Time Memory Function Location
1 0.0007 136096 {main}( ) ..\repeat.php:0
2 0.0012 138200 require_once( 'E:\directory\ceshi\lianjie.php' ) ..\repeat.php:3
( ! ) Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in E:\directory\ceshi\repeat.php on line 28
Call Stack
# Time Memory Function Location
1 0.0007 136096 {main}( ) ..\repeat.php:0
2 0.0048 144248 mysql_query ( ) ..\repeat.php:28
注册不成功返回
代码<?php
require_once 'lianjie.php';
$name=$_POST['name'];
$password=$_POST['password'];
$repeat=$_POST['repeat'];
// $code=$_POST['check']; //验证码!
if ($name==""|| $password=="") {
echo"用户名或者密码不能为空";
}
else
{
if($password!=$repeat){
echo "两次输入的密码不一致,请重新输入!";
echo "<a href='register.html'>重新输入</a>";
}
// else if($code!=$_SESSION['check']){
// echo "验证码错误!";
// } //验证码!
else{
$sql="insert into user value('$name','$password')";
$result=mysql_query($sql);
if(!$result){
echo "注册不成功";
echo "<a href='register.html'>返回</a>";
}
else{
echo "注册成功";
}
}
}
?> 展开
( ! ) Notice: Undefined variable: name in E:\directory\ceshi\lianjie.php on line 4
Call Stack
# Time Memory Function Location
1 0.0007 136096 {main}( ) ..\repeat.php:0
2 0.0012 138200 require_once( 'E:\directory\ceshi\lianjie.php' ) ..\repeat.php:3
( ! ) Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in E:\directory\ceshi\repeat.php on line 28
Call Stack
# Time Memory Function Location
1 0.0007 136096 {main}( ) ..\repeat.php:0
2 0.0048 144248 mysql_query ( ) ..\repeat.php:28
注册不成功返回
代码<?php
require_once 'lianjie.php';
$name=$_POST['name'];
$password=$_POST['password'];
$repeat=$_POST['repeat'];
// $code=$_POST['check']; //验证码!
if ($name==""|| $password=="") {
echo"用户名或者密码不能为空";
}
else
{
if($password!=$repeat){
echo "两次输入的密码不一致,请重新输入!";
echo "<a href='register.html'>重新输入</a>";
}
// else if($code!=$_SESSION['check']){
// echo "验证码错误!";
// } //验证码!
else{
$sql="insert into user value('$name','$password')";
$result=mysql_query($sql);
if(!$result){
echo "注册不成功";
echo "<a href='register.html'>返回</a>";
}
else{
echo "注册成功";
}
}
}
?> 展开
1个回答
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询