PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 26th, 2005, 12:19 PM
s2y16 s2y16 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 4 s2y16 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 49 sec
Reputation Power: 0
Exclamation Control for the pages after user log out

I would like to ask that is there any functions or methods to prevent user go back to the system page after they log out. Besides that , I also need to control the page so that user cant get into the content pages even they key in the url.. Anyone know the solution please tell me ..... Thanks

Reply With Quote
  #2  
Old February 28th, 2005, 09:16 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
Setting the page's cache and expiry time often does the trick.
This tells the browser not to cache the page.
When the browser makes its second visit, it checks for a new page. If the user isn't logged in, you won't display the page.

If you want to disable caching, look into the header() method...

PHP Code:
<?php
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

// always modified
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
 
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0"false);

// HTTP/1.0
header("Pragma: no-cache");
?>


There are side-effects. The browser will potentially ALWAYS hit your server for a new file. If you have many users, this will slow down your server.

Reply With Quote
  #3  
Old February 28th, 2005, 02:16 PM
Viper_SB's Avatar
Viper_SB Viper_SB is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Canada
Posts: 331 Viper_SB User rank is Private First Class (20 - 50 Reputation Level)Viper_SB User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 4 h 53 m 7 sec
Reputation Power: 6
another method would be to check for a session variable, and that variable is only set when they log in. of course this would be the same as above and make it always hit your site, and like madcow said if you have a lot of users this will slow it down more.

Reply With Quote
  #4  
Old March 1st, 2005, 05:35 AM
s2y16 s2y16 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 4 s2y16 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 49 sec
Reputation Power: 0
I will try the methods that proposed by u guys .. Thanks a lot for ur all suggestion ....

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Control for the pages after user log out


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT