Mehul Jain is a web- designer-developer-author from India. He has a deep interest in the field of web development, loves to experiment with php, css and javascript and wants to share his experiences and thoughts with the world.

Mehul's articles

  1. Simple Captchas with PHP and GD

    By now, we’ve all encountered captcha images in online forms. Captchas are a necessary evil, and this article will teach you how they’re made.

    Please note that while there are better, automatic third party solutions for captchas out there such as ReCaptcha, this tutorial aims merely to explain and demonstrate how such technology actually works. We won’t be explaining what captchas actually are, as it’s assumed to be common knowledge and already covered in greater detail elsewhere.

    Drawing captchas

    You must have the GD(Graphics Draw) library installed before proceeding. This library enables drawing of graphics and images through built-in PHP functions. To install it, run sudo apt-get install php5-gd or if on non-Ubuntu-based operating systems, follow instructions.

    Captchas are usually made up of 3 things – shape, distortion, and the text.
    We’ll follow the steps mentioned below:

    1. Display an empty image on the browser.
    2. Create a shape.
    3. Generate random lines.
    4. Generate random dots.
    5. Generate random text.

    The procedural style used in this article is present only because this is a proof of concept, and to keep the final file as simple as possible. In a real project, you would go OOP.

  2. PHP and Neo4j: Introduction to Graph Databases

    For a long time, data has been typically stored in tabular form so as to increase the indexing and readability. Nowadays, the trends are changing as Graph databases are quickly gaining popularity. In fact, it would not be wrong to call them "the future of DBMS". New to the world of graphs and databases? Don't […]