|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (6 bit)
Join Date: Apr 2002
Location: new orleans, la
Posts: 55
|
hi, i have a page on my website that i don't want surfers to be able to access without viewing the home page first. is there some html coding for this. i also don't have a cgi bin. thanks for any info.
-jon |
|
|
|
|
|
#2 |
|
Staff
Premium Member
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
|
You could probably do it pretty easy with PHP. Just make a conditional based on HTTP_REFERER. If the referer was not the home page (or any other page on your site) then you would redirect them to the home page. You could also do it using a .htaccess file. Keep in mind though that visitors to your site don't generally like being redirected.
|
|
|
|
|
|
#3 |
|
Premium Member
Join Date: Jun 1999
Posts: 9,231
|
Hope this works :)
You could try putting something like
Code:
alert ("You came from " + document.referrer);
if (document.referrer != "http://www.site.com/index.html")
location.href = "index.html";
and if the previous page that the user visited was not index.html then the user is pushed to index.html |
|
|
|
|
|
#4 |
|
PCMech Founder
Staff
|
Above post was edited to handle a scripting problem.
|
|
|
|
|
|
#5 |
|
Member (6 bit)
Join Date: Apr 2002
Location: new orleans, la
Posts: 55
|
thanks, is that javascript? where do i insert it in the html? inside the head tags? also, i have about 20 pages total. if a user is on a page other than index.html and he clicks a link to the page i want to keep closed off, will that bring him to the index.html page as well? i would want to avoid that. thanks.
-jon Last edited by jon321; 02-20-2003 at 11:50 AM. |
|
|
|
|
|
#6 |
|
Member (6 bit)
Join Date: Apr 2002
Location: new orleans, la
Posts: 55
|
okay, thanks. i got it to work great. i think i can stand having it redirect users even if they already entered through the main page. but if there is some coding that could remedy that, i'd use it. thanks again.
-jon |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|