Introduction
This simple project is called Simple ID Generator Web App. This project was developed using the image functionality of the PHP GD library. This project will help you learn how to create a web application that will generate images mainly for creating ID cards in this simple project. The source code contains ideas/strategies for creating images in PHP, such as function and design position, size, etc. This simple project was developed using PHP, GD library, HTML, CSS, Javascript, and Bootstrap for the theme. Download Bootstrap CSS Framework.
How it works
Users simply enter their name and date of birth. After that, click the “Generate ID” button to generate an ID card. ID card includes static/default image, auto-generated his ID number, name, auto-calculated age, date of birth, issue date, header, footer, and background image.
Features
- Personal Information Form Field
- Generate ID Card
- Display Generated ID Card
- Download the Generated ID Card
Plugins Used
As I said above, the input fields are only name and date of birth. other information is statically programmed. My challenge as a PHP coder is to create additional fields to populate other information dynamically. This way you can learn more about using the image features of the GD library.
The complete source code for age calculation is available here.
If you don’t want my ID template, you can create your own using Adobe Photoshop
How to Run
Requirements
- Download and Install any local web server such as XAMPP/WAMP.
- Download the provided source code zip file. (download button is located below)
Installation/Setup
- Open your XAMPP/WAMP’s Control Panel and start the “Apache”.
- Extract the downloaded source code zip file.
- If you are using XAMPP, copy the extracted source code folder and paste it into the XAMPP’s “htdocs” directory. And If you are using WAMP, paste it into the “www” directory.
- Browse the Simple ID Generator Web App in a browser. i.e. http://localhost/id-card-generator/
DEMO