Prevent page access outside website
Prevent page access outside website
am 06.10.2007 15:11:36 von name
Hi.
I have a php webside with a guestbook and I want access to the guestbook
only via the homepage.
How can I modify the index.php of the guestbook to prevent access from
outside the website?
Any hints ?
Regards, Hans
Re: Prevent page access outside website
am 06.10.2007 15:54:50 von Shion
H@C0 wrote:
> Hi.
> I have a php webside with a guestbook and I want access to the guestbook
> only via the homepage.
> How can I modify the index.php of the guestbook to prevent access from
> outside the website?
> Any hints ?
Check the $_SERVER['HTTP_REFERER'] that it has a value that is a page on
your site, but keep in mind that this can be spoofed (spammers has no
problem at all to post automatically in your guestbook) and legitimate
users may not be able to post as their firewall filters ref-addresses
without them knowing about it.
--
//Aho
Re: Prevent page access outside website
am 06.10.2007 16:43:47 von Jerry Stuckle
H@C0 wrote:
> Hi.
> I have a php webside with a guestbook and I want access to the guestbook
> only via the homepage.
> How can I modify the index.php of the guestbook to prevent access from
> outside the website?
> Any hints ?
>
> Regards, Hans
>
You can't reliably. And whatever you do will make it harder for valid
users.
For instance, you could set a session variable in your home page, then
clear it in any other page on your site. Check for it in your guest
book page. If it's not set, don't allow the page to be loaded.
But it also means search engines won't be able to access your guest book.
The real question is - what problem are you trying to solve? If it's
guest book spam, this may help some, but won't stop it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Prevent page access outside website
am 06.10.2007 18:05:31 von name
It's not because of guest book spam, but my pagecounter tells me that
several times a day the guest book gets hits from "accidental" visitors.
Ok, it's not a big deal. I leave it the way it is.
Thanks for your responses.
Hans
Re: Prevent page access outside website
am 06.10.2007 23:23:01 von Jerry Stuckle
H@C0 wrote:
> It's not because of guest book spam, but my pagecounter tells me that
> several times a day the guest book gets hits from "accidental" visitors.
> Ok, it's not a big deal. I leave it the way it is.
> Thanks for your responses.
> Hans
>
Or, maybe someone has a link to your guestbook page.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================