PHP forward command not working when returning to web page

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
4dplane
Forum Newbie
Posts: 6
Joined: Wed Nov 25, 2009 11:51 am

PHP forward command not working when returning to web page

Post by 4dplane »

Hi,

I am using if (isloggedin()) in a php web page to produce two views for users who are logged in and users who are not logged in.

if (!isloggedin())
$content .= elgg_view("my1channel_pages/loginbar");
if (isloggedin())
$content .= elgg_view("my1channel_pages/loggedinbar");

The problem is if I am loggedin and I hit the logout button which forwards me to the home page the above code does not run. Only if I refresh the page does the code runs. If a user hits the back button taking you to the home page the above code does not run. Again refresh and it works.

So whats the problem here, is this not the correct way to implement this code to produce two different views?

One method I have tried is two force the browser not the cache the home page but its not working on all browser and it seems wrong.

Thanks,
4dplane
Post Reply