Crea sito

Archivio per giugno 2012

How to count the files inside a directory and the subdirectories

Count the files Here there is the problem: given a directory, we need to get the number of the files (not directory) inside this directory (and the subdirectory). Plus, we need to count the numbers of the files for each subdirectory, in the same way. For example, if we have a directory like this: directory1: […]

How to know which version of Ubuntu you are running

There are a lot of versions of Ubuntu spread all over the years, but which one are you running? It’s easy, the information that you need is stored into /etc/issue. So, just type:            cat /etc/issue and you’ll see which version of Ubuntu you’re running. For example, in my case, that’s […]

How to redirect to an other URL with PHP

Using PHP, there is a very easy way to redirect the web page that you’re visiting to an other URL. To do that you need to use the method header, in this way: header(“Location: new URL”); Example: <?php /* Redirect browser */ header(“Location: http://grassi86.altervista.org”); exit; ?> The method header is used to send a raw HTTP header. […]