sirkyuubi Posted April 25, 2011 Share Posted April 25, 2011 Hi everyone! This is my first post. Anyways I have been reading my amp book to learn apache mysql and php, but I ran into a bit of a problem that I cant figure out. I will attach my 3 files for everyone to see. I get this error after loading the login.php file and trying to type in the username and passowrd From what I can gather the username is ok, but there is an issue on line 9 where the password authentication is located which has me baffled. I can't find any syntax errors.... gksudo gedit /var/log/apache2/error.log [Mon Apr 25 05:29:23 2011] [error] [client 127.0.0.1] PHP Notice: Undefined index: userpass in /home/coolness/public_html/learn/movie1.php on line 9, referer: http://localhost/learn/login.php [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/234652-help-undefined-index/ Share on other sites More sharing options...
gristoi Posted April 25, 2011 Share Posted April 25, 2011 couple of things. Try and keep your syntax the same. Line 4 of movie1.php is in lowercase: $_session // should be $_SESSION and on line 8 you are using the word 'and'. This needs to be &&. Quote Link to comment https://forums.phpfreaks.com/topic/234652-help-undefined-index/#findComment-1205853 Share on other sites More sharing options...
sirkyuubi Posted April 25, 2011 Author Share Posted April 25, 2011 OMG that was a nub mistake!! thanks! Quote Link to comment https://forums.phpfreaks.com/topic/234652-help-undefined-index/#findComment-1205855 Share on other sites More sharing options...
trq Posted April 25, 2011 Share Posted April 25, 2011 and on line 8 you are using the word 'and'. This needs to be && The keyword 'AND' is a perfectly legitimate PHP operator. Quote Link to comment https://forums.phpfreaks.com/topic/234652-help-undefined-index/#findComment-1205858 Share on other sites More sharing options...
gristoi Posted April 25, 2011 Share Posted April 25, 2011 cheers thorpe. My bad. Have always been taught to use the keyword abbriviations. Quote Link to comment https://forums.phpfreaks.com/topic/234652-help-undefined-index/#findComment-1205860 Share on other sites More sharing options...
sirkyuubi Posted April 25, 2011 Author Share Posted April 25, 2011 I know what u mean. I've been programming in c++ its kind of a habit of mine too, but when I'm reading books I try to type the example exactly. Quote Link to comment https://forums.phpfreaks.com/topic/234652-help-undefined-index/#findComment-1205862 Share on other sites More sharing options...
trq Posted April 25, 2011 Share Posted April 25, 2011 && has a higher precedence than AND so they both have there place. Quote Link to comment https://forums.phpfreaks.com/topic/234652-help-undefined-index/#findComment-1205863 Share on other sites More sharing options...
sirkyuubi Posted April 25, 2011 Author Share Posted April 25, 2011 K. Well... Not sure what U need to do to close the thread, but everyone has been very helpfull! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/234652-help-undefined-index/#findComment-1205876 Share on other sites More sharing options...
Pikachu2000 Posted April 25, 2011 Share Posted April 25, 2011 There's a "Topic Solved" button below the last post. Quote Link to comment https://forums.phpfreaks.com/topic/234652-help-undefined-index/#findComment-1205879 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.