Change!

February 19th, 2009

Give your visitors the opportunity to change their outdated browser and get rid of Internet Explorer 6:
Give IE6 users the message to upgrade or change

That project seems to be offline but here’s something new, doing the same thing:
http://www.freethefoxes.com/

Buggy Specials Chars with non-English Keyboard in Flash

January 17th, 2009

I just experienced a realy weird problem with flash: I had a form in a flash. The form works fine in Internet Explorer. But in Firefox (not tested in other browsers) some special characters (capital umlauts, at-sign (@) didn’t work. The at-sign worked by pressing shift-2 (that’s default on EN-keyboards, but not on DE). After some searching I found out that removing the wmodeparameter fixes that. I’m not a flash guy so I can’t really explain it. While investigating my problem I found two articles describing wmode: Flash: wmode = transparent = evil (Firefox) (German) and Flash, DHTML Menus and Accessibility (English).

File Downloads with php in Internet Explorer

November 26th, 2008

For a web project with restricted access I wrote a script to download files via php. Basically I use rewrite rules to send the user to the php script, the script checks if the session is ok and sends the download (prepended by several headers) if the user has the proper permissions and the file is located in a directory that’s whitelisted.
Here’s the RewriteRule:

  1. RewriteRule ^/(downloads/.*) https://www.server.org/download.php?f=$1 [L,R,NC]

It worked fine except … Internet Explorer. In some cases, IE6 refused to save the file correctly. It just saved it with the name download.php and “unknown type”. Regardless of the type I sent along with Content-type and the name I sent with Content-Disposition.
Read the rest of this entry »

PEAR Mail_Mime::addHTMLImage() and Outlook 2002

October 24th, 2008

Yesterday I wasted hours trying to send emails with PEAR Mail. The inline images I added with Mail_Mime::addHTMLImage() just weren’t displayed in Outlook 2002 (aka Outlook XP). After hours of googling (bringing up a lot of snake oil tips) I found bug #13495 on PEAR: “urlencoded domainname in cid breaks mime mails in gmail”.

The cid (content id) is an ID that points to the different mime parts in multipart mails. As far as I know (I don’t know much about mime) it’s a unique ID followed by a domain. E.g.

15c0bf865f3884f33c22ff9e6109c9f3@leipold.ws

According to bug #13495 Gmail doesn’t like the @ in the cid. This has been fixed in Mail_Mime by urlencoding the cid.

Sadly Outlook 2002 didn’t cope with that. removing the urlencode helped showing the images.

Using exec on php/Windows

September 13th, 2008

I tried to run a program with exec() but it just didn’t run. It was a program with several parameters, each parameter escaped with escapeshellarg().

It didn’t do anything, had no return value and no output. After putting a pair of extra quotes around the whole command it worked:

  1. $arg1 = escapeshellarg("first argument");
  2. $arg2 = escapeshellarg("second argument");
  3. $cmd = "C:\\do-something.bat $arg1 $arg2";
  4. exec("\"$cmd\"");

In the German php documentation I found the hint that exec() executes cmd /c with exec’s first parameter as argument. Therefore the whole command has to be quoted.

Befreiphone

September 9th, 2008

Udo Vetter takes part in the Befreiphone-Wettbewerb and I try to support him :-)

Since Sebastian asked so kindly I’ll support half Udo and half Sebastian ;-)

Hey Collin, für einen Eigenen Artikel bin ich zu Träge. Du sollst aber Deinen Befreiphone-Link bekommen.

Automatic Upgrade for Multiple WordPress Instances

August 7th, 2008

Upgrading WordPress manually is boring. But there’s a cool plugin called Instant Upgrade, you can download it on the author’s homepage zirona.com.
This is a very convenient way to upgrade wordpress with two clicks.
Update: For WordPress 2.7 this is no longer necessary, a one-click update is built in.

But I administer several WordPress installations – all on the same host. Now I have written a small script that upgrades all instances by one command. In order to work the installation must be done via svn (or moved to svn).
Read the rest of this entry »

Serving flv files with IIS results in http error 404

April 22nd, 2008

If you try to serve flv files hosted on an IIS-Server you will most probable get a http error 404. This is because IIS only serves files where it knows the mime type. So if you get that error you will have to add a mime type for flv files.

You can add mime types in the Internet Information Services (IIS) Manager: Right click your server and choose “MIME Types…”. Here you can define new types by clicking new. The actual type can be video/x-flv. For details look at the wikipedia page Flash Video.

Installing php on IIS 6.0 – error 404

April 4th, 2008

I had trouble configuring php on IIS 6.0 – I did what the manual suggested to do but accessing a php-script resulted in an 404 error.

In IIS’s control panel (Internet Information Services (IIS) Manager) is a folder called “Web Service Extensions”. You have to add an extension and add php5isapi.dll (or php4isapi.dll I guess – haven’t tried php4) to the list of required files.

That should do the trick.

Deactivating the Browsers Autocomplete Feature for Input Fields

March 8th, 2008

Modern browsers often supply a list for inputs where you can choose from all previous entries for form fields with the same name. E.g. if you have a form field for an email address with name="email" you can choose any email address you entered before in fields with name="email". Sometimes it’to deactivate that feature – if you supply a list with suggestions via AJAX or, in my case if the field appears within a suckerfish menu. You just need to supply the autocomplete-attribute:

  1. <input name="email" autocomplete="off" />

This is non-standard, but as far as I know it works on all modern browsers.

Greetings to ??? I’m happy that you read my blog :-)

Page optimized by WP Minify WordPress Plugin