Archive for the ‘PHP Scripts’ Category

Refreshing Map View (MKMapView) for iPhone development

Ok so i just spent a long time searching how to reload a map view. It’s quite simple [map setRegion:map.region animated:TRUE]; The problem i was having was when i was adding annotations i was adding them through a background thread. So if you want to reload a map after adding annotations make sure you are […]

Content Is Not Allowed In Prolog – Google API

Recently I’ve been having to work with the Google Provisioning and Email Settings API, which¬† I thought would be no big deal.¬† But soon, like a child who’s ice cream has just fallen on the ground, I was in tears and frustrated. The issue wasn’t necessarily the API, or the PHP code that I was […]

Messenger won’t sign in on mac

If you can’t seem to sign in to MSN messenger or windows live messenger on the Mac and it keeps saying there is an error or possible network connection. Click Sign in with a different account or change your online status -> Click the Clear Account History Button -> Restart the program -> Sign In […]

SWFUpload gets stuck at uploading…

Recently I came across a problem while installing SWFUpload on my latest site. I had the problem before but couldn’t remember what the solution was. When I uploaded a file with SWFUpload on my mac (OSX 10.5) it would get stuck at the uploading… status This was cause by my upload_url file not returning any […]

Can’t get image width or height using javascript in IE 7 and 8

Came across this one whilst working with an TinyMCE plugin. I had some additional css on the image i was trying to get the height and width of – display:none; That’s the problem. Just use visibility:hidden; in your CSS and all will be fine in the world. Oh just in case you are using the […]

Forms won’t submit in IE when pressing enter

Hi All I’ve come across this issue yet again. Realised I’d forgotten to post it the first time. Instance 1 – Form has 1 text field, when pressing enter the form doesn’t submit correctly, either won’t submit, or won’t send submit button value through to php. Solution – if ($noOfTextFields == 1) { //fix IE […]

Image Caching – Specifically for Firefox

Ok so it’s Friday and it’s 2:45pm. So close to the weekend and i just spent an hour or so figuring out how to get my image caching to work on my thumbnails. Against all odds i have managed to get firefox to cache images properly – well maybe how i want it is a […]

Function for dealing with quotes in input fields in HTML/PHP

Anyone who has coded html has come across this issue, you have an input field in your form but oh no! someone has entered a single or double quote into the value and they are now trying to edit it, and all you see in the input box is John\ instead of John\’s. It is […]

PHP Redirect Code – with javascript

Ever needed a redirect function that would know when to use javascript of php. Well the wait is over *crowd goes wild*…. sorry here it is To use the function simply call it like so: <?php $variables = array(‘firstvar’ => $firstVar, ‘secondvar’ => “hello world”); REDIRECT(“newPage.php?currentVar=123″, $variables); ?> and here it is again if you […]

$_FILES Array and its Confusing Structure

Have you ever noticed that the $_FILES array has an extremely odd structure that isn’t the usual type of array. The script i wrote helps to put it in an order so you can simply step through each one without having to write any sort of confusing loop. It’s implementation can be seen below: // […]