Referral Specific Welcome Message

admin

Administrator
Staff member
I've seen this set up on some blogs while surfing BlogExplosion - a specific welcome message (that isn't there when I view the blog otherwise) containing information on how to navigate the site and contact the author, etc.<br /><br />Well, my problem is a tad more serious than that.<br /><br />One of my friends has a long-running series on his blog wherein he posts semi-naked pictures of women for others' "enjoyment." Some of his readers come to my blog and look through my image folders, obviously under the impression that I'm running some sort of Playboy getup.<br /><br />Instead of banning them outright -- because a lot of his readers are nice people -- I'd rather a welcome message to let them know that they'll be S.O.L if they look for anything pornographic (other than certain textual entries).<br /><br />Anyway, long story short . . . is this possible and, if so, how?<br /><br />Thanks. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
Just drop an index page into your image directories with a general comment.<!--content-->
I was actually looking for something that would go on the main index of my blog, as I have some friends who I allow to sift through my image folders and I don't want a broad, all-encompassing page just because of a few morons.<br /><br />I'd rather just have something on the index, as this is where they first arrive at.<br /><br />I've seen it done on other blogs, as I said, but never get a response whenever I include a query in a comment.<!--content-->
So you want a specific message to display depending on where the visitor is coming from?<!--content-->
Exactly.<br /><br />It seems like it'd be extremely simple, but I can't wrap my head around it. (Exam burnout.)<!--content-->
Depending on how familiar you are with PHP you could check on the referrer, and then add a set of text, if they are coming from that site (or even display a different page)<!--content-->
If your main index page is a PHP page, you definitely could use PHP to do this:<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php<br />  if (strpos($_SERVER['HTTP_REFERER'], 'bad-domain.com') !== false) {<br />    echo('No naughty pics here for you!');<br />  }<br />?><!--c2--></div><!--ec2--><br />But if your main index page is not a PHP page, I think you'd have to use java script:<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><script type="text/javascript"><br />  if (document.referrer.indexOf('bad-domain.com') > 0) {<br />    document.write('No naughty pics here for you!');<br />  }<br /></script><!--c2--></div><!--ec2--><!--content-->
Oh good lord .. I can't believe I didn't think to do this - especially since I already have something like it in place already.<br /><br />Duur.<br /><br />Thanks! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
 
Top