Archive for the ‘Coding’ Category
April 21st, 2010
When developing a HTML web form the input field should always be allowed to be cleared by the user. The problem is that there is no default value to erase the contents on the field without using some JavaScript. The easiest way to get or modify the content of an element is by using the innerHTML property.
innerHTML is not a part of the W3C DOM specification. However, it is supported by all major browsers.
(more…)
Tags: Forms, innerHTML, JavaScript
Posted in Coding | 1 Comment »
April 14th, 2010
WordPress does not use sessions to hold any data being that it is a stateless application. This makes it quite a problem for tasks like a shopping cart, which requires data(the user’s selected product) to be remembered from one page to the next. This means that if you want to use PHP sessions in your plugins or custom modifications of WordPress you will need to do some custom coding.
Luckily the fix is a simple one that anyone can handle! You only need to do a little hacking to enable sessions within WordPress.
(more…)
Tags: How To, PHP, SESSION, WordPress
Posted in Coding | 1 Comment »
March 17th, 2010
WordPress is driven by a MySQL database which makes updating content cake once in the database. All of the WordPress data such as posts, comments, categories, and settings are stored within the MySQL database.
If you needed to change some information site wide, going through each and every record would prove a very time consuming task and also be prone to human error. By executing a SQL query against your WordPress database however, you can make the necessary changes quickly and efficiently.
We will show some SQL queries that can be of great assistance to you when using WordPress.
(more…)
Tags: database, localhost, MySQL, reset password, URLs, WordPress
Posted in Coding | 7 Comments »
February 10th, 2010
Using WordPress’s permalink feature seems to cause some issues with password protected directories that use Apache’s .htaccess to handle authentication. I recently had to troubleshoot why after installing WordPress on the root level of the domain that a password protected directory would return a 404 page instead of the typical login box.
The problem comes from the Apache rewrite engine that WordPress uses to make search engine friendly URL’s. WordPress uses a .htaccess file in the root folder of the install to take any URL and allow WordPress to process and serve the appropriate page, or error.
(more…)
Tags: .htaccess, 401, 403, Apache, ErrorDocument, errors, How To, password protect, WordPress
Posted in Coding | 5 Comments »
February 3rd, 2010
Utilizing URLs on your site that are search engine friendly is simple and easy to do thanks to PHP and Apache. We will be utilizing permalinks that get rid of all the nasty $_GET data that trails the end of most PHP scripts. An example of a SEO unfriendly URL we will clean is:
http://www.myguysolutions.com/article.php?id=123&title=seo-php-url
Using a combination of Apache’s ForceType directive, the PHP explode() function and PHP’s PATH_INFO variable we can easily turn the sample URL into:
http://www.myguysolutions.com/article/123/seo-php-url
This not only helps our website’s SEO (search engine optimization), but also accomplishes a security concept is known as “security by obscurity”. By obscuring the fact that our web site is using a PHP script, we may detract potential hackers from looking for exploits within our scripts.
(more…)
Tags: .htaccess, Apache, explode(), ForceType, PATH_INFO, PHP, SEO, URLs
Posted in Coding | 4 Comments »
January 27th, 2010
With the Apple Tablet the iPad arriving it is time to finally learn how to give your web site an icon for Apple touch devices. Have you visited a website on an iPhone or iPod touch and attempted to tap Add to Home Screen only to be disappointed by the results? Years ago the favicon.ico was only found on a few select websites, but today they can be found just about everywhere. The apple-touch-icon rel link attribute has become Favicon 2.0 in today’s web.
This time stay ahead of the curve and learn how to add an icon for your website to an Apple touch device.

By default instead of getting a nice shiny icon, the iPhone will shrink down the homepage of that site and save the capture as the webclip. It is surprisingly simple to create a custom Apple touch icon for your website in two quick steps.
(more…)
Tags: apple, favicon, icon, iphone, ipod touch, link rel, webclip
Posted in Coding, Design, Graphics, Inspiration | 2 Comments »
January 20th, 2010
One major design element often overlooked by web developers is their 404 File Not Found error page. Most our focus gets lost on CSS and XHTML validation that we often overlook what happens when something goes wrong. Even these pages should be styled with the individual touches of the website. Effective 404 error pages communicate why a particular page couldn’t be displayed and what users can do next.
Who wants their users to see the dreaded default 404 page:

Creating your own custom 404 File Not Found Page can be done in three simple steps by creating or modifying the .htaccess file of the directory and placing a 404.html file in the same directory.
(more…)
Tags: .htaccess, 404, Apache, ErrorDocument, errors, How To, public_html, www
Posted in Coding, Design | No Comments »