Page 1 of 1
[help] refresh problem.
Posted: Sat May 12, 2007 5:40 pm
by fishown
so first, hello every one, im new
so ..my problem is when i re enter to page,
its dosent update until i refresh it =\
example:
i loged in to my members-only page.
and when i log out its shows me that im still connected until i refresh it..
what do i need to do?
Posted: Sat May 12, 2007 5:56 pm
by Sparky
Do you mean that it still shows you as logged on *on the page you're viewing* that you clicked log out on?
If that's the case - it means the bit of code that handles the log out occurs after the output is created... This may not always be obvious, though - such as:
if($userloggedin)$login_display = 'User is logged in';
if($logout)$userloggedin = false;
echo $login_display;
Very over-simplified way that the code to handle being logged out occurs before the output is create that says they're still logged in ...
Is that any closer to solving it?
Posted: Sat May 12, 2007 6:16 pm
by fishown
mm no sorry dude you dident get me right =\....
i will give auther example:
i have one page that got script to delete row from the database.
when i click "delete", its delete the row from the data base,
but doesent reload the page again =\.
so you see the same row as befor the deleteation
Posted: Sat May 12, 2007 6:48 pm
by Sparky
It still sounds like the same problem - that the script is deleting the data after sending the content ...
However, if (for some reason) it absolutely needs a refresh, why not simply reload the page? A few ways to do that - using a javascript reload or using a META tag is the easiest way...