PHP Scripts and Javascript Source Code
Free copy and paste scripts in PHP code and Javascript code.
PHP Scripts
Please remember to save scripts with a ".php" file extension so they run. Also remember to credit this website.
- Free Web Counter Script - counts hits, records time, ip address and referring page
- PHP Dos Tree Command Script - acts like the old dos tree command listing all files under a directory
- PHP Site Map Script - generates hypertext links to all your web pages
- PHP URL Validation Script - checks if domain name or url is valid
- PHP Form Security - stops robots from using your form
Javascript Source Code
- Javascript Check Form Script - how to use Javascript to validate the data entered into a form.
Add Bookmark Script
<script language="JavaScript1.2">
<!--
var bookmarkurl="http://www.templatetool.co.uk"
var bookmarktitle="Templates and Scripts"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
//-->
</script>
HTML Code Snippets
Search Script
This code displays a search string entry box and a search submit button.
To customize this search script replace the action="" URL with a cut and paste of a search result URL minus the query string part e.g. q=search+string Then edit name=q to whatever your favoured search engine uses.
<form action="http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=on" target="_blank"><input name="q" type="text" value="" size="30" maxlength="64"> <input type="submit" value="Search">
</form>
Google and other search engines offer free search box code with graphics and site search. See here for some examples of search engines that provide such code.