PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hello guys,
i wonder what goes wrong with my code which involved sessions.. and received the following message bellow.
[quote]Notice: Undefined index: [b]some message line whatever # here[/b]
The search identifier had errors.[/quote]
here's my LogIn script that will then process to the index.php page...
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Last edited by victhour on Wed Dec 06, 2006 12:27 am, edited 1 time in total.
Considering the number of index references you have in your code, it would help to know the exact error you are seeing if you want specific help fixing that problem.
The problem comes from assuming an array element exists when it does not. isset() and array_key_exists() are often used to detect the existence of the element before it is used as to avoid or fix code that would otherwise cause errors such as this.
Considering the number of index references you have in your code, it would help to know the exact error you are seeing if you want specific help fixing that problem.
i received something like:
Notice: Undefined index: ses_id in C:\Web Root\script\index.php on line 34
The search identifier had errors.
then i try to remove $_SESSION['ses_id'], it will just move to the next Undefined index 'usr_id' and so on...
"genid" is their to give some value to $_SESSION['ses_id'], like $_SESSION['usr_id'] = $getrow['id_mas']; where 'id_mas' is a some key from a database.
im not sure if i explained it correctly.. coz my english is not that fluent
by the way. i check the "session file" generated, and there values some thing like:
The following line will generate a notice when the session is first created. It attempts to read a session variable ($_SESSION['ses_id']) when it doesn't exist yet.
feyd wrote:The following line will generate a notice when the session is first created. It attempts to read a session variable ($_SESSION['ses_id']) when it doesn't exist yet.