Work
ftp open in explorer by default in windows
by Adrian on Jul.27, 2009, under Programming, Work
How to make explorer open by default when opening an ftp connection, I found can be easy..
I needed to make IE6 style FTP access without the extra pop up step, from a desktop shortcut at work and after much googling, and messing with the registery, attempting to make an ftp site open immediatly in explorer without the main browser opening (pre IE7), I found it can be simply done like this.
1. create a bat file (open notepad, save the file with the affix .bat, making sure .txt is not selected in the dropdown)
2. in the batch file add
1 | start explorer ftp://USERNAME:PASSWORD@FTP_SERVER_ADDRESS |
3. add the shortcut to the desktop, and style the icon
Now when the user clicks the shortcut, voila IE6 style FTP access without the extra step, much easier than poking around with the registery
0 in $_GET is empty in PHP
by Adrian on Nov.12, 2008, under Programming, Work
Whilst at work,
I was writing a cart for an e-commerce site I am building.
The Cart consisted of a multi-dimensioned array, part associative, part indexed, anyway of note here is that,
A. It was an array.
B. The contents where indexed numerically
C. Arrays as you know begin at zero.
When removing an element from the cart, the elements indexed value, is passed via GET to be handled via the object, for removal.
It seemed to work fine, until I attempted to remove the first element, after a little debugging, I noticed the “0″ value was being interpreted by PHP as empty?
WTF?
A quick mock up code later
1 2 3 | <?php if (!empty($_GET['get'])) echo "I RECIEVED A GET WITH VALUE: ".$_GET['get']; ?> |
and a check in the url
nameOfFile.php?get=1 displayed “I RECIEVED A GET WITH VALUE: 1″
nameOfFile.php?get=0 displayed “”
It seems that according to PHP the value zero is interpreted as empty because it is being handled as a string when used within GET.
But…………….
A string, as the name suggests is just a string of characters, strung together, it is an array of characters, or bytes, the fact that it held zero, would be irrelevant would`nt it not?
I can understand if it was attempting to cast the datatype to an integer, but again, zero is still zero.
The only scenerio I can see this being valid if it where NULL!
PHP uses loose datatypes or lucid?
Adrian Callaghan`s graduation
by Adrian on Oct.08, 2008, under Work
This is recent footage from the graduation ceremony, I have edited out all the boring stuff, so only about 20sec`s remains.
It was a lovely day, and I am glad I attended..
General discussion RSS Feed