TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
JOHN JOHNNNY
NA
190
140.9k
Notice: Undefined index: name
Feb 11 2016 2:04 AM
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
[syntax=php]
<?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);
}
?>
[/syntax]
Kindly help
Reply
Answers (
3
)
School System registration process
PHP, XAMPP, PHPmyAdmin