Multiple MySQL query with PHP

// Enter multiple query string $query_str = ” — Update table UPDATE t SET id = id + 1; — Insert into table INSERT INTO example (name, age) VALUES(‘John Doe’, ’23’ ); “; // Explode string into separate queries $query = explode(‘;’,$query_str); // Loop through exploded queries and execute foreach($query as $index => $sql) {… Continue reading Multiple MySQL query with PHP

IE6 change cursor to pointer or hand on any element

IE6 only supports :hover on <a> elements. To change the cursor to a pointer or hand on hover of any non-anchor element, say a div: In css div { cursor:hand; cursor:pointer; } Do not add the pseudo state ‘:hover’, and it will work cross browser.

Coda – Error code 37 – “Host Key Changed for…”

Coda error code 37 is caused when a site’s ip address changes. This causes the SSH keys to no longer valid. It can be fixed by connecting via SSH with Terminal, inside Coda, and reading the response. The response will tell you what line needs to be deleted in the known_hosts file. The known_hosts file… Continue reading Coda – Error code 37 – “Host Key Changed for…”

Allow PHP to access files but not website visitors

Add the following to an .htaccess file, and all .php files under the .htaccess file will not be available via the web: <FilesMatch “\.php$”> Order deny,allow Deny from all </FilesMatch> The files will be available through PHP though. As PHP is not requesting the files through Apache webserver, rather is it requesting include files via… Continue reading Allow PHP to access files but not website visitors

webcal link in IE

webcal links (eg. webcal://www.domain.com/calendar.ics)will only work in Internet Explorer if Outlook 2007 is installed on the users machine. Office 2003 or earlier do not install the support required to make webcal links active.

“This page contains both secure and nonsecure items” IE fix

Use a CGI proxy service on your secure site. Download CGIProxy. Upload to your sites cgi-bin folder (most hosting packages will have that set already). Once uploaded, change the permissions of the ‘nph-proxy.cgi’ file to 755 (rwxr-xr-x) Owner=Read,Write,Excute   Group=Read, No Write, Excute   Everyone=Read, No Write, Execute. Visit the CGI script on your secure… Continue reading “This page contains both secure and nonsecure items” IE fix

Supporting iPhone custom protocols

The iPhone Safari browser supports several extra protocols to launch their corresponding apps: Apple documentation on iPhone integration sms ex. Text this ( <a href=”sms:5555555555″>Text this</a> ) For SMS texting tel ex. Phone this ( <a href=”tel:5555555555″>Phone this</a> ) For regular phone calls youtube ex. Singing Shiba ( <a href=”youtube:rnXQDMDobHc”>Singing Shiba</a> ) Starting youtube videos… Continue reading Supporting iPhone custom protocols