Hi guys,
I’m having a bit of a problem.
I usally use this code just to confirm that a user has sent variables to the current page (they are post not get)—and the code works fine when the variables have been set, but when the page is loaded without the passed variables, i get this error:
A PHP Error was encountered
Severity: NoticeMessage: Undefined index: username
My code is:
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
$email = $_REQUEST['email'];
if(isset($username) && isset($password) && isset($email)){
// Looks good so far…
$showview = 'join/welcome';
}else{
$showview = 'join/retry';
}
I think it’s because the $_request is null (which is right—as the page has been deliberately loaded wrong), but instead of just leaving it unset for the php code to pick it up, codeigniter is displaying an error.
I do not want to turn error handling off, i would just like to know the proper way an experianced coder would handle the above.
Thanks so much!
Regards,