PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.php > Prevent page access outside website
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Prevent page access outside website

Réponse
 
LinkBack Outils de la discussion
Vieux 06/10/2007, 14h11   #1 (permalink)
H@C0
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Prevent page access outside website

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

  Réponse avec citation
Vieux 06/10/2007, 14h54   #2 (permalink)
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Prevent page access outside website

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
  Réponse avec citation
Vieux 06/10/2007, 15h43   #3 (permalink)
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Prevent page access outside website

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 some, but won't stop it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
  Réponse avec citation
Vieux 06/10/2007, 17h05   #4 (permalink)
H@C0
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Prevent page access outside website

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

  Réponse avec citation
Vieux 06/10/2007, 22h23   #5 (permalink)
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Prevent page access outside website

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
==================
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h28.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11353 seconds with 13 queries