Categories
Uncategorized

Creating an auto-forwarding web page

There are times when we want a web page to automatically redirect to another page. You may or may want to have a message displayed first.

In the first example here, the page will forward instantly, without displaying any message.

1
2
3
4
5
6
7
8
9
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta http-equiv="refresh" content="0;url=http://www.example.com">
    <title></title>
  </head>
<body>
</body>
</html>

In the second example, a message will be displayed with a delay before the next page automatically loads.

1
2
3
4
5
6
7
8
9
10
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta http-equiv="refresh" content="5;url=http://www.example.com">
    <title></title>
  </head>
<body>
<p>The following page will load in 5 minutes</p>
</body>
</html>

The key to all of this is in the content attribute on the fourth line of each example:
<meta http-equiv="refresh" content="5;url=http://www.example.com">

This attribute is in two parts, an integer followed by a URL. The integer is the number of seconds to pause, and should be set to zero if you don't want any pause at all.

If you do wish to pause before the page is forwarded, you should probably put a message in thesection as seen in the second example above.

To have a website or folder forward to another URL, just create an index.htm file with the appropriate code and place it in the website root or folder.

Categories
Uncategorized

Easy Password Generator in PHP

This function will return a password of the length passed as a parameter. It's handy for automated processes to reset a password and mail a temporary password to a user who has forgotten their password, or for any other purpose which requires a random string.

The $p variable provides a list of characters eligible to be used in the password. You can see that I've omitted characters that can be mistaken, like a lower case "L" or an upper case "i" or a zero and upper case letter "O".

1
2
3
4
5
function GeneratePassword($len) {
	$p="2346789abcdefghjkmnprtuvwxyz";
	for( $i=0; $i < $len; $i++) { $s.= $p{rand(0,strlen($p))}; }
	return $s;
}
Categories
Uncategorized

Using PHP/MySQL with Google Maps

Courtesy of Google:

http://code.google.com/apis/maps/articles/phpsqlajax_v3.html

Categories
Uncategorized

Speeding up your PC

A collection of tips for improving the performance of your PC.

Temporary Internet Files

Dumping your browser cache should speed things up.

In IE, select Tools > Internet Options > Delete Files… will clear the cache.

Then you can limit the size the cache will grow to by selecting Tools > Internet Options > Settings… and limiting the cache to 100 mb or so.

Slow Browser Performance

The Java cache setting defaults to 1,000 Mb, far larger then needed. A setting of 100mb would be sufficient for most users.
To fix this: Start > Control Panel > Programs (if necessary) > Java. Under Disk Space, change the space allotment from 1000mb to 100mb.

Categories
Uncategorized

WordPress Plugins & Ideas

This is just a collection of plugins that I find useful or have caught my attention.  I haven't tried them all, this is just my little scratchpad to keep notes on these things.

  • http://wordpress.org/extend/plugins/menu-manager/
  • Bubblecast Video for WordPress Flash video player, embed YouTube, WordPress MU fully supported, …

And some reference ideas for working with WordPress