undefined index id

Codes here !

Moderators: egami, macek, gesf

Post Reply
jagjittcl
New php-forum User
New php-forum User
Posts: 9
Joined: Wed Jul 03, 2013 10:14 pm

Sun Jul 07, 2013 10:32 pm

Hi

I am getting the above error on line

$query = "select id,firstname FROM master WHERE id " .$_GET['id'];


$(document).on('click', '.editBtn', function(){
$.ajax({
url: 'update_form.php',
data: {'id' : $(this).closest('td').find('.userId').text()},
dataType: 'json',
success: function(data)
{
console.log(data)

}
});

});
Thanks

johnj
php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Mon Jul 08, 2013 3:08 am

you need to validate $_GET['id']. you need to verify if this id has a value. You can use isset() to do this.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests