注意:未定义的索引:名称 [英] Notice: undefined index: name

查看:452
本文介绍了注意:未定义的索引:名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在我的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆