注意:未定义的索引:名称 [英] Notice: undefined index: name
问题描述
嗨
我在我的php代码中收到以下错误
注意:未定义的索引:C中的名称:\ wamp \ www \\ _senmplifiedcodding\register.php on第3行
注意:未定义的索引:第4行的C:\ wamp \www \ simplelcodding \ register.php中的名称
注意:未定义的索引:名称在第5行的C:\ wamp\www \simplifiedcodding\register.php中
注意:未定义的索引:C中的名称:\ wamp \ www; \\ simplecodding \ register。第6行的php
看下面我的php代码
Hi
I am getting the following errors in my php code
Notice: Undefined index: name in C:\wamp\www\simplifiedcodding\register.php on line 3
Notice: Undefined index: name in C:\wamp\www\simplifiedcodding\register.php on line 4
Notice: Undefined index: name in C:\wamp\www\simplifiedcodding\register.php on line 5
Notice: Undefined index: name in C:\wamp\www\simplifiedcodding\register.php on line 6
see my php code below
<?php
$name = $_GET['name'];
$username = $_GET['username'];
$password = $_GET['password'];
$email = $_GET['email'];
if($name == '' || $username == '' || $password == '' || $email == ''){
echo 'please fill all values';
}else{
require_once('dbConnect.php');
$sql = "SELECT * FROM users WHERE username='$username' OR email='$email'";
$check = mysqli_fetch_array(mysqli_query($con,$sql));
if(isset($check)){
echo 'username or email already exist';
}else{
$sql = "INSERT INTO users (name,username,password,email) VALUES('$name','$username','$password','$email')";
if(mysqli_query($con,$sql)){
echo 'successfully registered';
}else{
echo 'oops! Please try again!';
}
}
mysqli_close($con);
}
?>
Kindly help
我尝试了什么:
我试过用Google搜索但是没找到正确答案
What I have tried:
I have tried googling it but have not found the right answer
推荐答案
name =
name =
_GET [' name'];
_GET['name'];
用户名 =
username =
这篇关于注意:未定义的索引:名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!