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…
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…
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…
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…
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,…
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…
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…
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…
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,…
10 htaccess usefull tips
The “.htaccess” is a configuration file that works at directory level on the web servers (on Apache, not on Microsoft…
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…
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:…
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…
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…
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.…
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…
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…
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…
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…
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…
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…
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…
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…
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…
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…