MySQL supports MD5() and some other cool functions that do the math for you and save the result in the table field, but what happens when you already have a database and the table in place and you are...
YouTube has multiple servers for serving images of the videos, hosted on the site. However, there is a quick trick to get a URL to any video's still image/thumbnail in YouTube....
Counting elements in a <select> dropdown is trivial, but often an issue for beginners in jQuery. In this short article, you will find how to easily get the count of <option> elements in a ...
On many occasions, you may want to check if the current visitor is browsing your site through a mobile browser. There are a lot of solutions out there (classes, libraries), but the simplest option has...
This simple snippet of code will help you get the full URL of the currently viewed page. function getUrl(){ $domain = $_SERVER['HTTP_HOST']; $url = "http://" . $domain . $_SERVER['REQUEST_URI']; retur...
Getting the thumbnail of a Youtube video through it’s ID is not that hard. You just have to transform the URL a little bit to get a high quality JPG file, used as a main thumbnail through Youtub...
Sometimes you will get an error similar to this in PHP: Parse error: syntax error, unexpected $end in /index.php on line 36 This is most likely caused by a forgotten closing curly bracket (“}...
Sometimes, while working with Cookies in PHP you may want to make a cookie never expire (e.g. in a rating script where you set a cookie on user’s computers, although it’s not wise to use c...
This PHP login script example is a very simple login system which you can use as a base for your future projects. You should note that it needs to be secured before using on a live system. Some things...
Sometimes you may want to hide the contents of a page (e.g. admin page) in a very simple manner. The best and simplest method is to use the PHP’s built in HTTP authentication. It’s both se...