Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 11-12-2008, 07:14 PM   #1 (permalink)
Unmountable Boot Volume
 
Cyrus_the_virus's Avatar
 
Join Date: Sep 2007
Location: Kerala
Posts: 907
Default Urgent HTML help needed!!


Hi All,

I have been faced with a unique problem while i was creating a website. I have html and php pages. The problem is I have few pages which shouldn't be directly accessed.

For eg: Page1, Page2 and Page3

Now, I do not want anyone to access Page2, and Page3 directly. Page2 should be accessible only from Page1 and Page3 should be accessible only from Page2. So, one page is linked to the other. However anyone trying to access page2 and page3 directly with it's linked should get a 404 error.

Can anyone help? I need to resolve this before midnight tonight!!
__________________
Webhosting for Rs12/month!!
http://www.thinkdigit.com/forum/showthread.php?t=74717

http://www.outpowerhosting.com
Cyrus_the_virus is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 11-12-2008, 07:19 PM   #2 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: Urgent HTML help needed!!

You can choose to prevent hotlinking. But I am not sure if that will work or not! Moreover, people whose browsers are set not to send referrrers may never be able to see the pages.

If nothing helps, PHP can do it for sure, though it a bit more complicated.
EDIT: I just realized that it would be more easier than anything with PHP!
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता

Last edited by victor_rambo; 11-12-2008 at 07:27 PM. Reason: Automerged Doublepost
victor_rambo is offline  
Old 11-12-2008, 07:25 PM   #3 (permalink)
Legen-wait for it-dary!
 
dheeraj_kumar's Avatar
 
Join Date: Dec 2004
Location: Chennai
Posts: 2,471
Default Re: Urgent HTML help needed!!

You can do something using referrer links, although I dont know how to. Thats the complicated PHP rohan is talking about, I think.
__________________
If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file
dheeraj_kumar is offline  
Old 11-12-2008, 07:45 PM   #4 (permalink)
Unmountable Boot Volume
 
Cyrus_the_virus's Avatar
 
Join Date: Sep 2007
Location: Kerala
Posts: 907
Default Re: Urgent HTML help needed!!

Quote:
Originally Posted by rohan_shenoy View Post
If nothing helps, PHP can do it for sure, though it a bit more complicated.
EDIT: I just realized that it would be more easier than anything with PHP!
I don't mind if it's php because, then i can just wrap the html inside the php, so as long as someone can tell me how to do it, it doesn't matter if it's php or html.

One thing that i was thinking of was to use mod_rewrite to mask the urls of all the pages to a single url, hence the end user wouldn't know the link for direct access to pages. eg: mask page1, page2, page3 url to http://abc.com/abc.php. Now the user can't tell what is the link to page2 or page3.

The only problem is I do not know how to use mod_rewrite!!

Quote:
Originally Posted by dheeraj_kumar View Post
You can do something using referrer links, although I dont know how to. Thats the complicated PHP rohan is talking about, I think.
It does not matter how complicated it is as long as someone can give me the entire script!!
__________________
Webhosting for Rs12/month!!
http://www.thinkdigit.com/forum/showthread.php?t=74717

http://www.outpowerhosting.com
Cyrus_the_virus is offline  
Old 11-12-2008, 07:56 PM   #5 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: Urgent HTML help needed!!

Just insert this snippet at the start of every page
The expected referer is the referer you want
Eg: in page2.php, expected is 'http://domain/page1.php', similarly for page 3
PHP Code:
if($_SERVER['HTTP_REFERER']!='expected referer')
{
header('Location: 404.php');//redirect to file not found error document
exit;

And yeah, the 404.php should contain the snippet
PHP Code:
<?php
header
("HTTP/1.0 404 Not Found");
?>
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline  
Old 12-12-2008, 04:28 AM   #6 (permalink)
Unmountable Boot Volume
 
Cyrus_the_virus's Avatar
 
Join Date: Sep 2007
Location: Kerala
Posts: 907
Default Re: Urgent HTML help needed!!

Thanks a lot, my job is done now.
__________________
Webhosting for Rs12/month!!
http://www.thinkdigit.com/forum/showthread.php?t=74717

http://www.outpowerhosting.com
Cyrus_the_virus is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Free GUI Based HTML editor needed? iMav QnA (read only) 4 03-05-2008 10:27 AM
Help on Javascript and html needed Kalyan Programming 3 05-11-2007 12:20 PM
Urgent: HTML Programs/Projects g_goyal2000 QnA (read only) 2 08-02-2006 07:42 PM
Urgent: HTML Programs/Projects g_goyal2000 Software Q&A 4 08-02-2006 10:13 AM
urgent help needed hyde QnA (read only) 1 07-06-2005 11:43 PM

 
Latest Threads
- by gforz
- by soumya
- by Sujeet
- by icebags
- by Charan

Advertisement




All times are GMT +5.5. The time now is 03:03 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2