How to reset post IDs
ShareI have a news site that grabs and posts things automatically, so I want to periodically reset the post ID number, just because I want to be able to keep the ID short and because I only keep posts that are about 3-day old. So, if you’re like me and for whatever reason you want [...]
Redirect using .htaccess 301
ShareOne of the better and easier ways to redirect is using .htaccess 301 redirect. What is “.htaccess”?
“.htaccess is a configuration file for use on web servers running the Apache Web Server software. When a .htaccess file is placed in a directory which is in turn ‘loaded via the Apache Web Server’, then the .htaccess file [...]
Script, Show or Hide
ShareEither embed the following code or save to a file and link to it in your HTML.
/*
*/
function showLogos()
{
var showbox = document.getElementsByTagName("DIV");
for(var i=0;i<showbox.length;i++)
{
if(showbox[i].className == 'show')
showbox[i].style.display = 'block';
}
saveCookie("showbanners",1);
}
function hideLogos()
{
var showbox = document.getElementsByTagName("DIV");
for(var i=0;i<showbox.length;i++)
{
if(showbox[i].className == 'show')
showbox[i].style.display = 'none';
}
saveCookie("showbanners",0);
}
Configure your ON button with this.
<a href="javascript:" onclick="showLogos();return false;">
Configure your OFF button with this.
<a href="javascript:" onclick="hideLogos();return false;" >
Wrap your object around a DIV like this.
<div class="show">
Follow this link below to see script in action.
Turn-your-cookies-on Script
ShareWhen loaded, this script informs your site visitors to turn on their cookies.
<script type="text/javascript">
<!--
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Chris :: http://www.freewebs.com/javascript_1/ */
if (navigator.cookieEnabled == 0) {
alert("You need to enable cookies for this site to load properly!");
}
-->
</script>
Clear Text Box When Clicking on It
ShareIf you have a text box on your webpage (eg – a search form) with text in it (eg – “Search…”), it adds an extra level of convenience for your user if the text box clears when the user clicks inside the box. This is achieved with some simple javascript:
<input onclick="this.value='';" name="Search" type="text" value="Search..." />
The crucial part is onclick=”this.value=”;” – [...]
Disabling Form Double-Submits
ShareHere is the simplest bit of javascript code that I found worked the best. Just add the following code to your submit button:
onclick="this.disabled=true,this.form.submit();"
The javascript is executed the first time someone clicks the submit button. The first bit of code ‘this.disabled=true‘ disables the button so it can’t be clicked again. The second bit of code ‘this.form.submit()‘ [...]
Disable Right Clicking and Image Saving
ShareAdd the following javascript to the header of your HTML page to disable right clicking. This prevents users from directly saving images from your website. It’s not foolproof by any means – users can still screen capture your web page or use a variety of other means to save your images but it’s one more [...]
Image Rotation Script
ShareThis is by far one of the simplest way to rotate through a folder of images. Script by Dan P. Benjamin of Automatic Labs (automaticlabs.com).
Down load this script [ rotate.txt ] then change the extension to .php
Drop script into the same folder where the images are.
Point image source to “http://www.yourdomain.com/yourimagefolder/rotate.php”. That’s it.
<img src=”http://howtocreateawebsite.biz/sitebuildit/rotate.php”>
An example for [...]
Website Monitoring
ShareIf you have many domain names, and/or pointers to domains, that you do not visit at least daily you may want this script. It will tell you if your sites are having issues. For example, what if someone hacked your registrar and pointed your domain name to another DNS (yes, this actually happened to me)? [...]
Tips for keeping your website secure
ShareHere are a few Tips for keeping your website secure:
Set up a new ftp user. Do not use your primary control panel user for ftp. That way if your ftp user/password does get compromised at least they do not have access to all your settings (although they could still get to some of them through [...]
