Suntower
Posts: 225
|
| Posted: 06/09/2009, 11:07 AM |
|
Hi,
I usually use ASP so I am not sure how to do the following.
We have a WordPress blog (in PHP). We'd like to prevent users from accessing the blog directly, but rather only getting there from our web site HTML page. Is there a snippet of code someone could provide that we could add to the index page of the WordPress Blog that would exit() if the referring page is not our HTML page?
TIA,
---JC
_________________
---On a campaign for more examples and better docs! |
 |
 |
melvyn
Posts: 333
|
| Posted: 06/09/2009, 11:38 AM |
|
if($_SERVER['HTTP_REFERER'] == "http://suntower/home.html"){
// allow access. do nothing here
}else{
header("Location: http://suntower/home.html"); // send the visitor to the homepage
}
_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com |
 |
 |
Suntower
Posts: 225
|
| Posted: 06/09/2009, 10:13 PM |
|
You rock. Like a hurricane, baby. Just what I needed.
CHEERS!
---JC
Quote melvyn:
if($_SERVER['HTTP_REFERER'] == "http://suntower/home.html"){
// allow access. do nothing here
}else{
header("Location: http://suntower/home.html"); // send the visitor to the homepage
}
_________________
---On a campaign for more examples and better docs! |
 |
 |
|