C and C++ Programming Resources

Share/Save/Bookmark
Custom Search

Check URL

Posted on October 22nd, 2008

This script is particularly useful for those who have their site on a free webspace provider, then use a “come.to” redirecting service. What this script will do is analyze the URL the visitor is at, and if they did not came to your site via the redirecting URL, it can print out a message telling them that is your new URL. Neat!

/*******************************************************
*     MYCPLUS Sample Code - http://www.mycplus.com     *
*                                                     *
*   This code is made available as a service to our   *
*      visitors and is provided strictly for the      *
*               purpose of illustration.              *
*                                                     *
* Please direct all inquiries to saqib at mycplus.com *
*******************************************************/

<!-- ONE STEP TO INSTALL CHECK URL:

   1.  Add the first code to the BODY of your HTML document  -->

<!-- STEP ONE: Add the first code to the BODY of your HTML document  -->

<body>

<script LANGUAGE="">

<!-- This script and many more are available online from -->
<!-- The  Source!! http://javascriptsource.com -->

<!-- Begin
if (location.href.indexOf("come.to") != -1){
document.write("Thanks for visiting!");
}
else {
document.write("Our new address is http://come.to/......");
}
// End -->
</script>

<!-- Script Size:  0.58 KB  -->

Tags: ,

Like What you See?

Become one of the regulars by subscribing! You'll be the first to know when we add more great posts just like this. Join up by either RSS Feeds or Email Updates today!

There are No Comments to this post. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response or TrackBack from your own site.


Leave a Reply

You must be logged in to post a comment.