drbigfresh Posted April 14, 2007 Share Posted April 14, 2007 I just started getting this error: Notice: Undefined index: username on this line: if ($_GET['username'] != '' && $_GET['password'] != '') { It was all working fine 20 minutes ago.... And now I can't figure out why it's throwing me an error. Anyone spot anything? Thanks! Link to comment https://forums.phpfreaks.com/topic/46969-simple-errordriving-me-mad/ Share on other sites More sharing options...
fert Posted April 14, 2007 Share Posted April 14, 2007 It's because $_GET['username'] or $_GET['password'] isn't set Link to comment https://forums.phpfreaks.com/topic/46969-simple-errordriving-me-mad/#findComment-229043 Share on other sites More sharing options...
mmarif4u Posted April 14, 2007 Share Posted April 14, 2007 1st define this above ur if statement: $_GET['username'] or $_GET['password'] Link to comment https://forums.phpfreaks.com/topic/46969-simple-errordriving-me-mad/#findComment-229044 Share on other sites More sharing options...
per1os Posted April 14, 2007 Share Posted April 14, 2007 if ((isset($_GET['username']) && $_GET['username'] != "") && (isset($_GET['password']) && $_GET['password'] != "")) { Should solve the problem. Link to comment https://forums.phpfreaks.com/topic/46969-simple-errordriving-me-mad/#findComment-229045 Share on other sites More sharing options...
The Little Guy Posted April 14, 2007 Share Posted April 14, 2007 <?php if (empty($_GET['username']) || empty($_GET['password'])) { //if user name or password is empty, do some stuff. } ?> Link to comment https://forums.phpfreaks.com/topic/46969-simple-errordriving-me-mad/#findComment-229047 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.