30
Aug

As posted before, I bought a camera to shoot some photos. Well, that has paid off.

Currently, my photos are used on two different websites.

2 of my photos are here: http://www.luckyfonziii.com/page/photos/14-troubadour-festival-leeuwarden-2382009
This is a troubadour from the netherlands. On a festival I made some pictures, and he added them to his website.
5 of my photos (including the 2 from above) are used here: http://3voor12.vpro.nl/artikelen/artikel/42399723
It is dutch, but it’s about the same festival.

More photos, check my flickr: www.flickr.com/photos/topener

Announcement

I haven’t been posting much recently, this because I am quite busy lately. It’ll come back ;)

07
Jul

Recently I was wondering how long an url can be at max. So I searched the Internet, and this is what i found:

Internet Explorer FireFox Safari Opera Apache
2048 65536 visibleAt least 100.000 At least 80.000 At least 190.000 Approx 4000

I found this on the Internet, and i thought I’d sum it up for you. Might be useful. The article i found this on is from 2006, but is still something you can rely on. Most results are “at least” or “approx” because the person who wrote the article stopped testing.

But, still don’t know why browsers support moreĀ  than 100.000. Because the servers never support that much. On the link below are some explanations and other results.

Source: http://www.boutell.com/newfaq/misc/urllength.html

, , , , , , , ,

02
Jul

I am working a lot with PHP, and also developing on a live CMS. Because there are already people using the system i don’t want errors to appear.

So, i tried to find a way to fix that. And, i found it. Ofcourse I did, because else this post wouldn’t excist.

This is the row that sets a new default error handler function:

$old_error_handler = set_error_handler("myErrorHandler");

And this is the function:

function myErrorHandler($errno, $errstr, $errfile, $errline)
{
   // Do something with the vars you get from this function.
  // $errno = Error number. Every type of error has an number ;)
  // $errstr = text to explain the error. The one you always see by default
  // $errfile = File the error occurred in
  // $errline = Line number in $errfile the error occurred at.
}

Check for more information www.php.net/set_error_handler

, , , , ,

29
Jun

Just recently I bought myself a new digital camera. This time a Sony A350 with a Tamron 18-200mm lens.

Now its time to figure out how everything works, but I’ll get there ;) If i got some nice pictures, I’ll show you. Right now, this is my camera.

, , , , , ,

04
Jun

Recently I was talking about ksort() to sort array, but i forgot to mention the reversed method. (link)

krsort($ray);

This function sorts an array reversed. So Z – A instead of A – Z.

, , ,

31
May

A problem I encountered recently was, after a short search on the internet, easy to fix.
I was trying to arrange an array in php by it’s keys, but I didn’t know how at first. This is my array

$ray = array('2' => 'second', '1' => 'first', 'a' => 'alpha);

As you noticed the order is 2 – 1 – a. But i want to arrange it to 1 – 2 – a. The only thing I had to do was this:

ksort($ray);

Thats all you need to do. And it will arrange the array by key.

, , ,

21
May

Something i recently discovered, and already regret I didn’t knew this before, makes it much more easier to parse $_POST or $_GET variables into ordinary variables so i can use it properly for mysql insertions.

This is what i used to do:

<?php
   $var1 = mysql_real_escape($_POST['var1']);
   $var2 = mysql_real_escape($_POST['var2']);
   $var3 = mysql_real_escape($_POST['var3']);
?>

Ofcourse we all can see the repeat in this, but i never figured out how to solve that issue.
But ofcourse there is always someone else with a better idea, and I like to share it with you

<?php
  foreach ($_POST as $key => $value){
    $$key = mysql_real_escape_string($value);
  }
?>

And thats simply all. It will put all the $_POST array items into a numerous variables.
The double “$” does what you expect it to do, it makes a variable out of the content of the variable.

When $a = test, than $$a = test2 will result into $test = test2.
It is that easy!

, , , , ,

18
May

Some time ago i discovered jQuery. A great and easy tool to do lots of fun stuff with animations.

But, it also makes Ajax much more simpler.

Just check out this documentation: http://docs.jquery.com/Ajax

, ,

06
May

I already am blogging at phpz.nl but that blog limited me to just PHP.

Because I am working with a lot javascript recently, and wanted to share that as well I decided to make a fresh start, on a new website, with more options for me.

I will keep blogging here, so for both javascript and PHP this will be the place to be! Thanks for joining.