Jump to content

Recommended Posts

Posted

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.

 

Well, my problem is a tad more serious than that.

 

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.

 

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).

 

Anyway, long story short . . . is this possible and, if so, how?

 

Thanks. ;)

Posted

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.

 

I'd rather just have something on the index, as this is where they first arrive at.

 

I've seen it done on other blogs, as I said, but never get a response whenever I include a query in a comment.

Guest Serpentine
Posted

So you want a specific message to display depending on where the visitor is coming from?

Posted

Exactly.

 

It seems like it'd be extremely simple, but I can't wrap my head around it. (Exam burnout.)

Posted

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)

Posted

If your main index page is a PHP page, you definitely could use PHP to do this:

><?php
 if (strpos($_SERVER['HTTP_REFERER'], 'bad-domain.com') !== false) {
   echo('No naughty pics here for you!');
 }
?>

But if your main index page is not a PHP page, I think you'd have to use java script:

><script type="text/javascript">
 if (document.referrer.indexOf('bad-domain.com') > 0) {
   document.write('No naughty pics here for you!');
 }
</script>

Posted

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.

 

Duur.

 

Thanks! :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...