duanbai1370 2018-06-17 07:53
浏览 77

未定义的索引:第22行的C:\ xampp \ htdocs \ DreamPark egistered.php中的城市

I'm trying to figure out whats wrong with this code, I'm making a simple registration form with php.

These are the errors i'm getting

Notice: Undefined index: City in C:\xampp\htdocs\DreamParkegistered.php on line 22

Notice: Undefined index: Age in C:\xampp\htdocs\DreamParkegistered.php on line 23

Notice: Undefined index: Gender in C:\xampp\htdocs\DreamParkegistered.php on line 24

inserted

And this is my php code.

<?php 


$con = mysqli_connect("127.0.0.1","root","");

    if(!$con)
    {   
        echo "Not Connected" ;  
    }

if(!mysqli_select_db($con,'dreampark'))
    {
        echo "Datebase not selected";
    }


$Name = $_POST['Name'];
$Email = $_POST['Email'];
$Password = $_POST['Password'];
$Mobile = $_POST['Mobile'];
$City = $_POST['City'];
$Age = $_POST['Age'];
$Gender = $_POST['Gender'];

$sql= "Insert into customers (Name,Email,Password,Mobile,City,Age,Gender) Values ('$Name', '$Email','$Password','$Mobile','$City','$Age','$Gender')";



if(!mysqli_query($con,$sql))
    {
    echo " Not Inserted";
    }
else
    {
    echo "inserted";
    }


//header("refresh:2; url=SystemHome.html");

?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!