![]() |
Notice:
:-):-/Can any body tell me wat is this error for plz
Notice: Undefined index: login in C:\wamp\www\kamsar_011208_server\registration\user \query\general_query.php on line 3My general_query.php is PHP Code:
|
if($_SESSION['login']=='true')
You are checking if the login session is true, but apparently there is no session with a name like that. You could put a check before that line with: if(isset($_SESSION['login'])){} to check if the login session exists or not. |
But
But the problem is the page loads the home page loads with the same error(s) and when i put this code
PHP Code:
and when i try to login in admin page it logins without any username and password |
If you can access the admin page without logging in, it means that your not validating if the user is logged in or not.
You have to put a check around the whole admin page and not for 1 line of code. PHP Code:
|
When you run
PHP Code:
|
Basically what that warning is saying is that your trying to use an index of an array in a statement before you have actually defined the index.
So there are two ways you could overcome this. The first is the code that Parvus posted and the second way is by setting a default value for that index if it hasn't already been set yet (this method is better if you are referencing the index many times throughout your scripts. PHP Code:
|
| All times are GMT. The time now is 04:36 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0