Simply Breath Teching…

Resources for PHP Programmers and Small Business Operators

Entries for the ‘PHP Scripts’ Category

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 text at [...]

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 incorrect javascript as [...]

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 bug where if there is only [...]

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 missed it
and voila!
If you liked it let [...]

$_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:

// a file [...]