Javascript – Opening Multiple Pages in an iFrame

Here’s a useful bit of javascript, that should help you action multiple web tasks which use the URL query string to past a parameter or two… Simply add your URLs to the “urls” array list and open the HTML file in a web browser.

<div id="count"></div>
<iframe name="ifrm" id="ifrm" src="http://www.jasdev.co.uk" width="90%" height="90%"></iframe>

<script type="text/javascript">

var i = 0;
var urls = new Array();
urls[0] = 'http://www.bbc.co.uk';
urls[1] = 'http://www.bigfanta.com';
urls[2] = 'http://www.bigtango.com';
urls[3] = 'http://www.jasdev.co.uk';

next();

function next() {
if ( window.frames["ifrm"] )  {
window.frames["ifrm"].location = urls[i];
}
setTimeout("next()",3000);
i++;
document.getElementById("count").innerHTML = i+' of '+urls.length;
}
</script>

Mac Automator Script – Download Assets using a text file

If you have web assets, such as images, pdfs, etc. which you wish to download as part of a website migrate project, where you don’t have access to the FTP account you may be stuck downloading them one by one… Unless you are on a mac, using the attached automator script (a tool available with mac osx). You can create a text file which contain all the full URLs of the web asset you require for your project, one URL per line and run the script to download them to your mac, with a few simply clicks. Download the script and let me know if it’s useful to you and your project.

filelist-downloader

htaccess – changing webroot folder

Ever wondered how to change the webroot of the web hosting package? Maybe you have two domains mapped to a single web hosting package, but you want both domains to act independently… Well you can with a .htaccess file in your public_html folder. Simply create a blank text file called “.htaccess” (if you don’t already have one) and add the following code:

# first domain
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?yourfirstdomain.com$
RewriteCond %{REQUEST_URI} !^/yourfirstdomain_folder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /yourfirstdomain_folder/$1
RewriteCond %{HTTP_HOST} ^(www.)?yourfirstdomain.com$
RewriteRule ^(/)?$ yourfirstdomain_folder/index.php [L]

# second domain
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?yourseconddomain.com$
RewriteCond %{REQUEST_URI} !^/yourseconddomain_folder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /yourseconddomain_folder/$1
RewriteCond %{HTTP_HOST} ^(www.)?yourseconddomain.com$
RewriteRule ^(/)?$ yourseconddomain_folder/index.php [L]

htaccess redirects

I find the best way to setup redirects of websites is to use the .htaccess file. It a plain text file which can help you get enhanced features on your website, one of them being 301 redirects. 301 redirects are used to redirect visitor’s URL requests if the URL has been permanently moved, and thus are great to let Google and other search engines know of structural changes and minimising the risk losing your ranking.

Here are some useful examples:

Domain Redirects

RewriteCond %{HTTP_HOST} ^(.*)yoursite.net [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^(.*)yoursite.co.uk [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^(.*)yousite.mobi [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]

Automatically add “www” to your URLs

RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Sub Domain redirects

RewriteCond %{HTTP_HOST} ^(.*)sub.yoursite.com [NC]
RewriteRule ^(.*)$ https://www.yoursite.com/sub/$1 [L,R=301]

Switch to SSL URLs for specific folders

RewriteCond %{HTTPS} off
RewriteRule ^folder1(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTPS} off
RewriteRule ^folder2(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Redirect all contain in specific folder

redirectMatch 301 ^/foldername/ https://www.yoursite.com/newfolder/

How to view ZIP file contents on Mac without extracting files

Viewing the contents of a ZIP file on a Mac without extracting the ZIP content has been missing from the basic functionality available on a standard OS X installation. Now you can download a small freeware plug-in for ‘QuickLook’ which fixes this issue. Allowing you to view the contents before extracting the complete ZIP file.

View the developer’s website for the download and installation instruction. Tested on Mac OS X Snow Leopard.

http://d.hatena.ne.jp/t_trace/20071125/p2

Are your passwords secure?

There has been an increase in recent months where websites have been hacked simply because the primary defense is weak. File Transfer Protocol (FTP) is used the upload website content from HTML pages to images, videos and audio files. FTP access is protected by a password, which if weak, can potential allow hackers access to your complete website, making changes as they see fit, usually resulting in negative consequences for you.  In any online application or service your password is your draw bridge allowing you access and keeping out the armies of hackers waiting to get in. Exploiting your website for they own needs and wants, sometimes without you even knowing.

So what is a weak password? Any dictionary word is weak, specially short words. Hackers simply have to throw the dictionary at your website and wait until it finds your password and gains them access. Your secure password should be a mix of “lower and upper case letters”, “numbers” and special characters, such as “£$%^&*”. The more abstract your password the more secure. As well as being a minimum of 8 characters and renewed at least every six months, never using the same password twice.

Yes this does make it difficult to remember, but “how important is your website/online application/online services”. Will someone hacking in and disrupting your business/your online status/SEO rank be worth have a weak password that you remember easily?

Get Your FREE Website Planning Guide

BigFanta Ltd has made available a newly compiled website planning guide, including sections on:

  1. Planning Your Website
  2. Building Your Website
  3. Marketing Your Website
  4. Improving Your Website

This provide usefully information on your to structure, built and most importantly marketing your website. Having a feature/media rich website is unless you have traffic to generate revenue. This may be through sales, memberships, advertisements, etc. Traffic generation in itself is a huge field of possible solutions, from SEO, Internet Marketing, Offline and Online Advertisements. Therefore along with BigFanta Website Planning Guide, you also get an additional eBook “Online Traffic Generation Methods”.

Get Them Now Free

SQL query for WordPress Posts

I have been trying to write a SQL select query for getting the all the posts made in wordpress blog (to create a latest news banner). This seem easy enough, doesn’t it. The problems arose due to the post revising done by the wordpress blog application, this was just added a layer of confusion. The wordpress blog database stores multiple records for a single post, one record each saved version of the post. However removing this layer, I found that a simple select query will do the job nicely, and here it is:

SELECT * FROM 'wp_posts' WHERE post_status='publish' order by post_date DESC

Nice and Simple :)

A Mac is 100% safe from PC virus…

Found this on the apple website, made me laugh…

Is a Mac safe from PC viruses?
Yes, a Mac is 100 percent safe from viruses designed to attack PCs.

Well, it should be – as not a PC, it’s MAC.

Both MAC and WINDOWS (PC) have security holes, the only reason why there are more viruses on PC is due to it huge market share. Ask the question, why invest time in developing a virus for a system which is not widely used? Isn’t more benefit to invest the same time, and get better results.