Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Server Side Programming > PHP Programming
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 05-04-2009, 08:10 PM
  #1
aarmale
Novice (Level 1)
 
Join Date: Oct 2008
Posts: 8
iTrader: (0)
aarmale is an unknown quantity at this point
Only allow from one page?

is there a code to make a page only acsessible from another page only? (e.g. pg1.php links to pg2.php and pg2.php works. pg3.php liks to pg2.php and pg2.php dont work.) Thank you!
aarmale is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 05-05-2009, 08:22 PM
  #2
scoutt
Mister Admin to you
 
scoutt's Avatar
 
Join Date: Jul 2001
Posts: 30,730
iTrader: (0)
scoutt is a jewel in the roughscoutt is a jewel in the roughscoutt is a jewel in the rough
Nope, being it is the web you can't reply on people just typing the page in.

But you could use a session on each page and if that session variable is not set put them back to the page it needs to be. You cannot rely on page referrer as it is harldy ever accurate.
__________________
Have a Script or Snippet you want to share?

WWW Standards: HTML 4.01, CSS2.1, CSS3, XHTML 1.0
PHP Standards: PHP Standards
scoutt is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-30-2009, 02:58 AM
  #3
nraboy
Novice (Level 1)
 
nraboy's Avatar
 
Join Date: Oct 2009
Location: California, USA
Posts: 7
iTrader: (0)
nraboy is an unknown quantity at this point
On the start page inside a php tag you could set a session to:

$_SESSION['page'] = $_SERVER['REQUEST_URI'];

What that does is it will make a session variable and store the current page file. In your case something like /pg1.php

Then when you visit your protected page you can do:

if($_SESSION['page'] == "/pg1.php")

Or whatever page you need to require. If it doesn't match your requirements then direct them out of there.

Nic Raboy

Last edited by Pegasus : 11-02-2009 at 02:54 AM. Reason: sig removed - you can have one after 30 days membership and 30 posts
nraboy is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  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 Off
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 02:40 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.