Dynamic PDF creation with PHP - Very Easy

November 22, 2007

FPDF is a PHP class which allows to create PDF files with PHP. The advantage is that PDFlib requires a fee for a commercial usage. F from FPDF stands for Free: So yu can use this class to generate PDFs for free and modify source code for your needs.

You must use this class if you want create PDF content directly from PHP to implement for example download of your site content in PDF dinamically. You can download it and see how it works in the sample code below.

(more…)

PHP - Simple authentication script with PHP_AUTH_USER and PHP_AUTH_PW

November 18, 2007

In this howto, we can create a little PHP authentication system with only few rows of PHP code. We can use header() function to submit the “Authentication Required” Message to the client browser, so on client browser we can see a dialog popup that require Username and Password. When we fill the fields, we can receive variables through arrays: “$_SERVER: PHP_AUTH_USER” and “$_SERVER: PHP_AUTH_PW”. We can use this simple authentication system only if PHP runtime is installed as Apache module.

Now we can see how it works through the source code:

(more…)

HowTo - Batch Image Resize on Linux

November 16, 2007

Suppose you want resize every your photos to put it on web. As you know, you can’t upload your photos on a webpage with the highest resolution because a web gallery became inaccesible and too slow to load. Suppose that you have a folder containing every photos of you holidays and you want resize it at 640 of width mantaining original aspect ratio. To make a resize there are many tools but I suggest a command line tool called “mogrify”. This tool will be installed with ImageMagick Libraries, so you have to install ImageMagick on you Linux.

(more…)

VirtualBox - Window XP virtualized in seamless modality on Ubuntu Gutsy 7.10

October 24, 2007

This is a screenshot of seamless modality. Cool effect!

Ubuntu Gutsy - Windows XP - seamless

Often there are many people that would like to use Windows XP because many software are only for Windows. If you install Ubuntu Gutsy 7.10 (Linux) and Windows XP in two divided partition you must reboot your system and choose every time a system to load when boot loader start up. There is a solution to make a unique desktop for both operating system: VirtualBox OSE in seamless modality. There are two version of VirtualBox: OSE and PE. OSE version is opensource, while PE version is free only for personal use. In this post we will use VirtualBox OSE. (more…)