2 questions - cookies , and code not appearing

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!

Moderator: General Moderators

Post Reply
gasoga
Forum Commoner
Posts: 36
Joined: Thu Apr 17, 2003 4:15 am
Location: Ireland

2 questions - cookies , and code not appearing

Post by gasoga »

Hi this might take a bit to explain: if i open two windows and login as two different people everytime i do something with the first person its fine but once you do something with the second person it will overwrite the cookie for the first person with the second persons details and now in either window you will be loged in as the second person. Can anyone tell me if there is anything i can do to stop this??

Second question is : when i login on my copmuter everything comes up fine like it is suppsoed to look , however when my boss login on his computer there is a chunk of the form that is missin , could this be becasue i have been programming on windows 2000 with internet explorer5 and his computer is xp with internet explorer 6?? Or does taht make a difference??

This is the code that appears on mine but not on his! :


Code: Select all

<?php

<?PHP
if ($HTTP_COOKIE_VARS['UserName'] == 'ikeane')
{
	VeiwAdminPage($ErrorCode);
}
if($HTTP_COOKIE_VARS['UserName'] == 'lmcgill')
{
	VeiwTimeSheet1($ErrorCode);
}
if($HTTP_COOKIE_VARS['UserName'] == 'jkeane')
{
	VeiwTimeSheet2($ErrorCode);
}
if($HTTP_COOKIE_VARS['UserName'] == 'ereid')
{
	VeiwTimeSheet3($ErrorCode);
}
if($HTTP_COOKIE_VARS['UserName'] == 'bmccormack')
{
	VeiwTimeSheet4($ErrorCode);
}
if($HTTP_COOKIE_VARS['UserName'] == 'mfrench')
{
	VeiwTimeSheet5($ErrorCode);
}
if($HTTP_COOKIE_VARS['UserName'] == 'carmstrong')
{
	VeiwTimeSheet6($ErrorCode);
}

?>
Any advice or ideas would be very welcome!
Thanx in advance!
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

1.
the problem is the cookie name, when you login the 2nd time it overwrites the first cookie with new values, the only way to stop that is to have a random cookie name maybe? you just have to set diffrenet name for each cookie.

2.
i hope your not useing frontpage lol, just check the html and make sure all the tags are closed.
Post Reply