WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : How to prevent users arriving on a subpage of your site when they arrive from a searchengine.
Categories : Java Script, HTML Update Picture
Peter Broerse
Date : Jul 07th 1999
Grade : 3 of 5 (graded 6 times)
Viewed : 4469
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Peter Broerse
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

Various searchengines index your entire site, thus allowing users to go directly to an subpage
in your website. This is nice for the surfer, but when using frames they probably won't be able
to get anywhere else unless you provide a link.

This gives an option to let the user go to the proper url:
Insert below the line all into the html-page to check.

<script language="javascript">
function CheckUrl(page){
if (window.location.pathname.slice(1) == page)
{Alert("You have arrived on a subpage, please click OK below to go to the proper website
address.");location.replace="http://yourwebsiteadress.xx/pagename.xxxx"
}
}
</script>

Now you call this function from the fololowing html tag.

<body onload="Javascript:CheckUrl('pagename.ext')" >

That's all.

You could also make the script available in a .js file on your site.
The you would add it on loading the page like this:

<script language="javascript" src="/path/scriptname.js"></script>

Should work okay.

If you ever find out how to reload the menupage and still keep the requested page in the
proper frame send me an email. I tried it and locally it works, but once online, it crashes..




Builds JavaScript that updates the contents of one selector based on another.
Categories : HTML, Java Script, PHP, Complete Programs, General
Javascript Background Scroller
Categories : Java Script, CSS, HTML
How to create <SELECT> menues that change on the fly according to other <SELECT> menues on the page?
Categories : Java Script, HTML
Prevent Right Mouse steal your graphics
Categories : HTML, Java Script, Security
Cool tool tip
Categories : Java Script, HTML, Web Design
Conditional Check - a script that allows a user to submit a form only if the user check a checkbox.
Categories : HTML, Java Script, Form Processing, Beginner Guides
Javascript linked dropdowns
Categories : Java Script, HTML, Classes and Objects
Javascript animated menu items
Categories : DHTML, CSS, Java Script, HTML
Page Loading Message shown during the time your site's page is being loaded.
Categories : HTML, CSS, Java Script
complete simply working javascript password generator file. Use letter, vowels, consonants (uppercase and lowercase) arrays to create a really random and secure password. improved security using time functions to initialize random number generator.
Categories : Java Script, HTML, Security, Authentication, Strings
Bookmarklets are simple tools that extend the surf and search capabilities of Netscape and Explorer web browsers.
Categories : Java Script, HTML, General
How to get the Focus (Cursor) into a Form-Element.
Categories : HTML, Java Script
Show or Hide your Content using Javascript
Categories : Java Script, HTML, CSS, Beginner Guides
Higly Customizable Javascript Calendar Script
Categories : Java Script, Calendar, Date Time, HTML, CSS
Bouncing Marquee at Status Bar
Categories : Java Script, HTML, Browsers