Friendly url’s giving a 404 error even though mod_rewrite is installed

When transferring a ModX site across to a newly setup cloud server I could only see the home page. After running through the ModX setup process again to get the manager’s file paths aligned correctly I checked through all the possible causes of this problem in the System Settings. Still no joy, all i got was a “File not found”. Continue reading “Friendly url’s giving a 404 error even though mod_rewrite is installed”

Mysql not found by PHP

In the middle of a Drupal install on my localhost I received the following error

No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) i…

2AM and in need of a quick fix I just created an alias in the location PHP was looking for mysql.

Replacing accented character with it’s standard character in PHP

When writing a function to save audio files with a user friendly filename , as well as a regex to remove any unwanted spaces and punctuation, I needed to replace any accented characters with their standard format.

e.g If I was saving a Beyoncé album I needed the ‘é’ in her name to be replaced with an ‘e’.

The following works perfectly:

iconv("utf-8","ascii//TRANSLIT",$filename);

Using Zend session with an HTML framset

Trying to incorporate a Zend session on a page being viewed as part of a frameset caused me a headache yesterday.

I couldn’t understand how everytime I refreshed the page to try and test the session it seemed to be reset. Var_dumping the session before and after the data was getting assigned showed that everything was getting stored as expected, but each time the page loaded, the session returned NULL again. Continue reading “Using Zend session with an HTML framset”

Nesting an onclick within an onclick

When trying to place an onclick function on a link in a table cell, which is part of a row which also has an onclick event, leads to both onclick functions being called.

After looking into how to go around this issue I used

This worked perfectly, stopping the parent onclick from firing, but when it came to testing in dreaded IE I found it wasn’t supported.

So I tried changing to:

This works just as well, not only in Firefox but IE too.

Continue reading “Nesting an onclick within an onclick”