Yearly Archives: 2010

PHP find previous monday from a date

This small function returns the date (with the format you want) of the previous monday from a given date. If…

Dicembre 3, 2010

Get URL parameter in javascript

Sometimes in javascript you have the variable that you need to use in the url, as a parameter passed in…

Novembre 25, 2010

Get file name in javascript

How to get the file name of the page? When you need to read the file name of the current…

Php Function to resize video from YouTube and Vimeo

When you make a web application that let the user insert video embeds coming from YouTube or from Vimeo, or…

Ottobre 6, 2010

How to integrate phpbb forum login

I have had to install phpbb forum on a website that already had a user table and I want to…

Settembre 17, 2010

How to change twitter status with php and curl without oAuth

Twitter api authentication Since the 31 of august 2010, twitter made its API more secure, stopping basic authentication calls. So,…

Settembre 9, 2010

PHP bot to get wikipedia definitions

Wikipedia, the collaborative and multilingual encyclopedia project, has a lot of usefull terms defined in its database, you can find…

Agosto 29, 2010

Send push notification to iPhone with PHP and pushme.to

UPDATE: 2013/11/18 This code no longer works, but you can check a similar function here: Sending push notifications with php…

Agosto 9, 2010

PHP to post on a Facebook page

Hi, I’ve modified the Mini Bot Class, I’ve fixed the Facebook status update and I’ve implemented the function to post…

Luglio 28, 2010

Parsing Flickr Feed with PHP tutorial

I’ve spent about 30 minutes to find a javascript embed to print out a custom thumbs list of flickr photos,…

Maggio 30, 2010

10 htaccess usefull tips

The “.htaccess” is a configuration file that works at directory level on the web servers (on Apache, not on Microsoft…

Maggio 2, 2010

Correct headers to download a CSV from PHP

With these headers you can force a download from php, for example, to let the user download a csv frmatted…

Aprile 27, 2010

Always remove slashes from GET and POST

This is a small piece of code that I use since many years. It removes all slashes from $_GET and…

Mini Bot Class Updated

Now there are 17 bots included in this class! Well I’ve updated the mini bots class with some new things:…

Aprile 9, 2010

PHP google images mini bot

UPDATE 2013/12/12: Now, in the  Mini Bot Class there is a version of this function that is still working. You…

Marzo 30, 2010

PHP parse url, mailto, and also twitter’s usernames and arguments

This small function receive a text as input and returns an html text with links if the source text contains…

Marzo 10, 2010

How to write a text description into html input type password

Sometime designers put form labels and instrucions into html inputs. One of the common uses is for login boxes when…

PHP curl bot to update Facebook status

I’ve found this great mini bot from Alste blog, and I’ve decided to add it to the mini bot class.…

Marzo 1, 2010

PHP to get twitter infos and avatar

I’ve just updated the Mini Bot Php Class with an improved version of the twitterInfo function, here is the code…

Ping pingomatic.com services with PHP

Ping-o-matic is a service that calls (ping) server engines and popular services to notify them that you have new contents…

Febbraio 24, 2010

Reading mp3 informations with php (id3 tags)

Inside mp3 files there are often some usefull informations stored. Those data are called “id3 tags” and deal with Author…

Febbraio 22, 2010

How to capture enter key pressed in a form (JavaScript)

Suppose you have a login form and you want to send the form when user press enter on his keyboard…

Febbraio 16, 2010

Mixing bots to gain new services

Spiders and bots let you take services from other web sites, this could be very cool, but also this could…

Febbraio 15, 2010

PHP function to fix collation on database fields of MySQL

This PHP function search for tables in the active db, match table’s name with the regular expression passed as first…

Febbraio 11, 2010

PHP how to calculate age from date of birth

This is a very simple script that starts from a string date in format yyyy-mm-dd and return the age. To…

Febbraio 10, 2010

ASP equivalent to PHP strip_tags

I’ve found those functions around in the internet and I put them here just to remind how to strip tags…

Febbraio 9, 2010

ASP Function to count files in a folder

This ASP function counts files of a specified extension inside a folder: this is done by creating a file system…

Fix html tags, close tags, repair bad quotes and more

This class can solve many problems coming from user generated html content or to fix html content before making some…

Febbraio 3, 2010

Recursive remove directory (RMDIR) in PHP

This small php function is a recursive remove directory that remove non empty dirs recursively. It enters every directory, removes…

Febbraio 2, 2010

Calculate dir size recursively with PHP (and count files)

This small PHP function lets you calculate the dir size entering each sub dir and making the sum of the…

Febbraio 1, 2010