Re: defeating a flash intro page

From: Date: Sun, 29 Oct 2000 08:15:12 +0000
Subject: Re: defeating a flash intro page
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-22581@lists.php.net to get a copy of this message
This might not be the best way, mine wont be flawless either, but maybe a little better. HTTP_REFERER is only set by some browsers, not all, it is also not set by a form submital. Cookie, as you said, are also not supported by all browsers, but Sessions will be :) With your code, if someone is currently in your site http://www.yoursite.com/test/read.php and modifies the URL bar to http://www.yoursite.com then your code, and mine (only if no cookie support), will redisplay the intro. index.php <? session_start(); if (!isset($SessionID)) { $SessionID = time(); session_register("SessionID"); echo "Display intro<br>\n"; } else echo "Don't display intro<br>\n"; ?> compile php with --enable-trans-sid and all your html will automatically be ajusted to take in for users that dont accept cookies. Chris Lee Mediawaveonline.com In article <BMEEJBCNBFEMOACLJPNGOEECCCAA.gascsd@gascairlines.com>, "Mark Peoples" <gascsd@gascairlines.com> wrote: > Ok, we're putting up a new site for an existing site, but we've got an > intro page that has a quick flash movie in it. Within the site, on every > page, there is a link to the 'root' page (href="/"), which, in our case > is index.php3 (of course <g>). > > The problem is that we don't want visitors to have to go through the > flash intro every time they come back to / . So, I got to thinking of > how to make this not happen. Well, it'd be easy with cookies, but not > all surfers are like Cookie Monster. =) Then, when looking through the > online manual for something else, I saw a reference to $HTTP_REFERER, > and remembered using it in the past for something else. > > So, my simple solution was: > > --index.php3-- > <?php > if(!(eregi("yourdomain.com", $HTTP_REFERER))) > { > //display what you want on your flash page... virtual() would probably > be > even better though > } > else > { > //display what you'd normally get when you click on 'Skip Intro' on > your > flash page > } > ?> > > The reason I do the !(eregi() is to make it easier to add it to pages > you've already got. Like... > > --index.php3-- > <?php > if(!(eregi("yourdomain.com", $HTTP_REFERER))) > { > //display what you want on your flash page... virtual() would probably > be > even better though > } > else > { > //display what you'd normally get when you click on 'Skip Intro' on > your > flash page > ?> > <i>here is some more html</i> > <p>You see this after you click on 'Skip Intro' or when you link from > another page somewhere on your site.</p> > <?php > } > ?> > > I'm sure someone else can come up with a better regular expression (eg, > like one to defeat a link from a search from yahoo)...something like > (this is totally wrong...it ain't PHP, it's *pseudocode*, I'm tired, > and, it's 1AM > <g>): > > eregi("http://????.yourdomain.com", $HTTP_REFERER) > > where ???? could be any valid sequence of characters of various lengths > in a URL so you could have links from sub-domain.yourdomain.com and > www.yourdomain.com that would work as intended. > > Have fun with it, but test it before you use it in production. =) > > marco > > >

« previous php.general (#22581) next »