URL rewriting con mod_rewrite

Spesso e volentieri, sul web, si incontrano degli indirizzi URL “brutti”: http://weblog.seanbone.ch/read.php?id=42 Questi indirizzi non hanno nessun significato per un utente, sono pieni di numeri, punti di domanda ed altri strani segni  – difficili da memorizzare o da ripetere ad un amico. E non bisogna nemmeno dimenticare il Search Engine, per cui l’URL è molto

Creating a basic log-in system

While building a website network like that of ZumGuy, there are certain elements and applications one will find oneself creating over and over. One of these is a simple PHP-based login system, and to save myself some time I have come up with a modular file I can simply copy-paste wherever it is needed. What

PHP: generare una stringa casuale

Si tratta di un’applicazione semplice ed estremamente utile per una varietà di applicazioni.Definiamo la funzione str_rand, che si basa su mt_rand di PHP, per generare la stringa: function str_rand($len = 32, $chars=’0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ’) { $str = ”; for ($i = 0; $i < $len; $i++) { $str .= $chars[mt_rand(0, strlen($chars) – 1)]; } return $str; }

Creating a secure contact form

One common application in web development is creating a contact form. The basic concept is very simple: you display a form, the user submits it and you send the submitted input to your self. There is, however, and inherent danger in this form: spammer bots may use it to send spam not only to you,

PHP: creating an automatic and dynamic banner

In this article I will illustrate a relatively simple PHP application, but which contains a couple of useful techniques: creating an automatic and dynamic banner. To keep it simple, it will simply be a series of images, but these techniques could really be used for anything at all. Nonetheless, it will include a couple of