Elijah Lofgren

I follow Jesus Christ and enjoy talking with people, taking pictures, reading, writing, helping people, and making websites. Who is Jesus?

My life mission: "Whatever you do, do it all for the glory of God." - 1 Corinthians 10:31

You are here: Home » Web Dev Tips

Contents

Website Development Tips and Tools

Flash

PHP

Javascript

  • Automatically create a page Table of Contents

    Use the QuirksMode Table of Contents script.

  • Debug your Javascript scripts by viewing the rendered source

    Install the View Rendered Source Chart Firefox extension.

  • Create Pop-ups Without Dead Links

    The SitePoint article Create Pop-ups Without Dead Links explains how you can create a pop-up that is both accessible to people with Javascript turned off and has a close link at the bottom of the pop-up for people with Javascript enabled.

CSS

Easily add rounded corners to your page

Use Nifty Corners Cube.

Easily make your stylesheet be formatted nicely

Use the online CSS Formatter and Optimiser.

Don't use numbers in CSS ids

CSS ids will not work with numbers in them. For example: instead of "#3rdcolumn" use "#thirdcolumn".

HTML

  • A Simple Character Entity Chart

    A Simple Character Entity Chart - I find this chart very useful when trying to remember the code to use for things like quotes and symbols.
  • Character Entity Encoder

    Character to entity encoder bookmarklet - If you've ever had problems with your HTML entity codes in textareas or text inputs being converted to the non-ACII text by your browser which causes the entities to be displayed incorrectly on your page, then here is bookmarklet for you! The character entitity encoder bookmarklet will encode all special characters to HTML entities in every text input and textarea on the current page. I have found this to be very useful and timesaving in managing pages on this site in which I use special entities.

phpBB

  • Use EasyMOD to quickly install phpBB mods

    Using EasyMOD is a fast convenient way to install MODs to your phpBB forum.

Apache Web Server

Easily set up Name-based Virtual Hosts

Just follow the example for what to add to httpd.conf in the Using Name-based Virtual Hosts section of the Apache HTTP Server documentation.

Enable .htaccess files

To enable .htaccess files follow these instructions:

  1. Open httpd.conf
  2. Find this section:
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit

    AllowOverride None
  3. Change:
    AllowOverride None
    to:
    AllowOverride All
  4. Restart the httpd server.

Fix 406 Not Acceptable error

Follow the instructions in the Disabling mod_security entry in the TextDrive Knowledge Base.

MySQL Database

Import a large MySQL file

Run the following to import a large MySQL file:

mysql -u USERNAME -pPASSWORD DATABASE < /path/to/sql/file.sql

Beware of using underscores in MySQL database names

For some really odd reason, underscores will sometimes not work in MySQL database names (at least for me). I don't know why this is, but I just wanted to warn you because I wasted an hour of my time try trying to track down a problem that was caused by having underscores in the MySQL database name.

Useful Programs

  • Konqueror makes a good FTP client

    I have come to find out that Konqueror is a great FTP client. It is especially useful when you want to upload a bunch of files overwriting the current ones (like a phpBB upgrade). To use its amazing FTP abilities just type: ftp://ftp.yoursite.com/ into the location bar and log in.

Javascript

Modified: 2007-05-18 17:27:50

HTML & CSS

Debugging Tools

Modified: 2007-06-14 12:19:45

  • IFRAME scroller - Added: 2007-05-18 17:28:15
    http://www.dynamicdrive.com/dynamicindex2/iframe-scroller.htm

Graphics

Use htaccess to redirect example.com to www.example.com

Modified: 2007-08-25 00:51:33

From htaccess to redirect domain.com to www.domain.com:

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

If you have a subdir with a .htaccess in it you will need to put it in there also. For example in /silverstripe/.htaccess I have this:

# Force www.elijahlofgren.com instead of elijahlofgren.com
# RewriteBase /
RewriteCond %{HTTP_HOST} !^www.elijahlofgren.com$ [NC]
RewriteRule ^(.*)$ http://www.elijahlofgren.com/silverstripe/$1 [L,R=301]

# RewriteCond %{HTTP_HOST} ^elijahlofgren\.com
# RewriteRule ^(.*)$ http://www.elijahlofgren.com/$1 [R=permanent,L] 

Server Setup

PHP & MySQL

  • MINUS query in MySQL - Added: 2007-07-16 21:55:01
    http://www.terminally-incoherent.com/blog/2005/08/19/minus-query-in-mysql/

Pages

    follow me on Twitter