March 8, 2007 by Matthew Capewell
I had a strange issue with IE6 recently where there appeared to be a random character that was displayed when the page was rendered:

It became apparent that it was actually the last letter from the above select element but it only happend in IE6 and not IE7 or Firefox.
The select element and the button are both floated, have % widths and are in a containing div which has an absolute width set in pixels. After much searching I found this article and I was able to fix it by using the following style on the button:
margin-left: -10px;
and the page then rendered correctly:

Don’t you just love IE6 bugs?!
Posted in CSS, HTML, IE6 | 1 Comment »
March 7, 2007 by Matthew Capewell
It is easy to get debug and process timing information out of an ASP.NET page.
To turn on tracing for a single page use:
<%@ Page Trace="true" %>
or to enable it at the application level put the following in the web.config:
<configuration>
<system.web>
<trace enabled="true" />
</system.web>
</configuration>
The trace of a single page is output at the bottom of that page’s HTML or if tracing a whole application (website) then the trace information is available at the URL http://mywebsite/trace.axd
Debugging statements can be output in the trace by using the following commands in the code behind:
Trace.Write("Starting some code...");
Trace.Warn("Some important event occured!");
Trace.Write("Finished some code.");
Posted in ASP.NET, IIS | No Comments »
February 7, 2007 by Matthew Capewell
Ever wondered where the line tool is in The GIMP?
All you have to do is select the ‘pencil’ tool, click on your image where you want the line to start, press and hold down the shift key and then click where you want the line to end. The two points should (hopefully) now be joined up by a straight line.
Posted in The GIMP | No Comments »
September 22, 2006 by Matthew Capewell
To restart the Apache webserver service you can run the following command in a Mac OS X Terminal window:
sudo /usr/sbin/apachectl restart
Posted in Apache, Mac OS X | No Comments »
September 22, 2006 by Matthew Capewell
To edit a file (for example /private/etc/httpd/httpd.conf) from the Mac OS X Terminal you can run the following command:
sudo pico /private/etc/httpd/httpd.conf
Posted in Mac OS X | No Comments »
September 22, 2006 by Matthew Capewell
In the file /private/etc/httpd/httpd.conf change the following line:
AllowOverride None
to:
AllowOverride All
In the file /private/etc/httpd/users/[user].conf change the line:
AllowOverride None
to:
AllowOverride All
Finally restart Apache using the following command:
sudo /usr/sbin/apachectl restart
Posted in Apache, Mac OS X | 2 Comments »
September 7, 2006 by Matthew Capewell
I haven’t been able to find much info on this but it is possible to run two websites (one .NET 1.1 and one .NET 2.0) on a single Windows Server 2003 server.
The key is to have them run in different application pools.
In IIS you can setup one website to run under the DefaultAppPool and then the other to run under a new one (e.g. DefaultAppPoolForNET2).
Posted in ASP.NET, IIS | No Comments »
September 7, 2006 by Matthew Capewell
I recently made what I thought was a transparent PNG but when I uploaded it onto the website it was transparent in Firefox but not in IE6.
After doing some searching, I found the following solution. Apparently IE 6 doesn’t support 24-bit PNGs with alpha channel so you need to convert the image to 8-bit.
- Open the original image.
- Set a proper background colour as oposed to it being transparent. It is best to make this colour similar to the background colour of the website to generate the antialiasing in your image borders in order for the image to blend nicely.
- Flatten the image (Image - Flatten image).
- Add an alpha channel (Layer - Transparency - Add alpha channel).
- Select the background color (Selection - By color).
- Clear the background colour (Edit - Clear).
- Convert the image to indexed color (Image - Mode - Indexed color).
- Save the image to the final PNG file (File - Save as) and remember to check: Save color values from transparent pixels.
Posted in IE6, The GIMP | 8 Comments »
September 2, 2006 by Matthew Capewell
To do this, load up the AppleScript editor and enter the following:
do shell script "..."
Replacing … with the command that you wish to run.
If the command requires administrator privileges then append the command with ‘with administrator privileges’ and then any subsequent commands with ‘and password’. For example:
do shell script "..." with administrator privileges
do shell script "…" and password
do shell script "…" and password
When the script is complete and tested save it as an ‘Application’ and tick the ‘Run-only’ checkbox.
Posted in AppleScript, Mac OS X | 1 Comment »
September 2, 2006 by Matthew Capewell
There are a number of options available to call a PHP script page from a Cron job. The option to use depends very much on your web host and how they have their servers configured. Option 2 is the one that I have found to work for me.
Option 1:
lynx -dump http://www.domain.com/file.php > /dev/null
Option 2:
php -q /home/username/public_html/file.php >/dev/null
Option 3:
wget http://www.domain.com/file.php
Option 4:
get http://www.domain.com/backup.php > /dev/null
Posted in Apache, PHP, Web Hosting | 9 Comments »