This exploit only existed in 2.2 and 2.3. It was patched in 2.3.1 which was released around four or five years ago. If you are running 2.2 and do not want to upgrade I wrote a tuorial on patching the exploit and it is in these forums or goto www.carbonize.co.uk/AG for the prepatched files.
I wrote a script to upgrade 2.2 to 2.3.x. It is available from www.carbonize.co.uk/AG and updating is highly recommended due to exploits. Update to either 2.4.1 or Lazarus. It's upto you.
Wow you just posted a hack that has been in the public domain for 4 years now and thats for a version of the guestbook that is 5 years out of date. Your mother must be so proud that you're so stupid.
I even know that you found the exploit on the net as you've posted it exactly the same way as ever site that has posted it. You don't even understand how it works.
1st - This is because AG has always used shell commands for moving uploaded images but some hosts do not allow this which is why I removed the exec lines from Lazarus and used pure PHP instead.
3rd - All the entries are stored in the database and the physical pictures in the public folder. Download 2.4.1, extract it, copy the database info from your current config.inc.php file to the 2.4.1 files, upload 2.4.1 to replace your existing guestbook (download a back up first) and finally run the update_db.php file founf in the new misc folder by visiting it in your web browser.