Display Message To Stumbleupon Visitors In PHP

Stumbleupon is a great way of getting lots of visitors to your site. All you have to do is submit your pages to Stumbleupon and when people stumble in their chosen topic they will find your page. The more votes your pages get the more likely they are going to be seen.

If all you need is more people to vote for your pages then why not ask people to vote for your pages?

All you have to do is add the following snippet to your page and you can display a custom message to Stumbleupon users asking for them to vote for your page.

<?php if( strpos($_SERVER[HTTP_REFERER], "" ) == true ): ?>
    <div class="welcome-stumbleupon">
        <p>Hello StumbleUpon user, please vote for this page by clicking the thumbs up picture in the toolbar.</p>
<?php endif; ?>
Back to top

Learn how to code with Treehouse

  • Learn projects with access to 1000+ videos
  • Practice live with our Code Challenge Engine
  • Get help in our members-only forums

Start with a 7 day free trial