Matt's Blog

Archive for the ‘Series’ Category

Tip of the Week: Backup

Saturday, August 4th, 2007

There’s one very simple thing that a lot of Webmaster’s don’t do, to Backup their sites. And, it can cost them. Many things can happen and your site will be gone forever, such as your server crashing and files being deleted, your site getting hacked, etc. Now, you don’t want that to happen, do you? I didn’t think so. There’s a ton of ways you can backup your site.

Yes, your host probably does make daily, weekly and/or monthly backups. But, these are usually for their purposes. Such as if a server crashes and all data gets erased, they’ll restore it from one of their backups. But, they don’t usually let you use their backups, and if they do, they might give you a retrieval fee to pay first.

First of all, FTP. You can use FTP to download your sites files to your computer, but it’s not particularly fast. A better way to Backup your site’s files is to use, if provided, a web hosting control panel. For example, cPanel has it’s own built-in Backup feature. You can download a full backup (all files + databases) or a “home directory backup” (all files). cPanel 11 even has a simple wizard to help you make a backup.

If your sites uses any databases, you should also back those up. Again, cPanel has a backup feature for this purpose. It’s on the same page as the file backups.

If you upgrade your site daily, I’d recommend doing a backup every day. But, if your site doesn’t get changed much, a weekly or monthly backup secudule might fit you better. If you have a Blog, and it’s updated everyday, you should backup the database everyday, and maybe the files every week. If you use WordPress, you can use the plugin WordPress Database Backup to have the database be backed up and emailed to you everyday, week, etc. automatically.

This has been the second Tip of the Week!

Tip of the Week: PHP Shorthand

Thursday, July 26th, 2007

And here starts a little series, “Tip of the Week”. I’ll post a little tip each week. Or, at least, until I decided to stop. 😛 (PS: I changed this to Week, instead of Day… 😛 )

To save time and file size, you can use “shorthand PHP”. To use this, this must be enabled in your php.ini (turn short_open_tag to on). Although not recommended for distribuatable code (since the user might not have shorthand PHP enabled), it’s great when you need to write something quickly. You can use <? and ?> for PHP opening and closing tags. You can even use ASP-like opening/closing tags, if asp_tags is set to on. You would then be able to use <% and %>. There’s also a shorthand for echo. <?= and <%= is equivalent to <?php echo. The previously noted options must be set to on to use the shorthand for echo, respectively. For example, <?='Text';?> would do the same thing a <?php echo 'Text'; ?>.