To fully implement this project in a working environment, you need to enable a lot of functions -- for example, the GD Library set of functions.
To implement this project in a production environment (although some features can still be added and improved for best user experience), you need to put four files inside the "opensourceidcreator" folder: ambient.ttf, idtemplate.png, index.php and personid.png.
You can customize the fonts by replacing ambient.ttf, as well as the idtemplate.png and personid.png. Of course, you need to revise the scripts to reflect these changes.
Here is a screen shot of the folder:
Next, upload the folder to the root directory of website supporting Apache-Linux web server.
You can even test this first on a local XAMPP server.
Third, open the URL in the browser, if you have a domain. For example, if your domain is myphpprojectdomain.com , then it will be:
Of course, as stated earlier, you can further improve this application by adding a web form that allows users to input their name and id number, and accepts image templates and an ID picture.
A complete working application can be found here: http://www.php-developer.org/opensourceidcreator/?name=Codex%20Meridian&idnumber=694569
Since name and idnumber are the input variables for the PHP script, you can change it to anything you like, and it will be written to the ID image template shown in the browser. So If I revise this to:
Then the URL will be http://www.php-developer.org/opensourceidcreator/?name=John%20Doe&idnumber=78954
Your browser output should look like:
Finally, you can right click on the image and save it to your desktop. Once saved, you can resize it to standard ID card size, and then print it. After that, you can laminate the card to make it your identification card. The advantage of this is that you can share it with your friends in other places without needing to install third party application software -- if you enable them to upload image files and enter their own names and ID number on a website where this project has been hosted.
Aside from creating ID pictures with a name tag, you can also use this application to create business cards or calling cards using PHP.
You can download the complete PHP project files from here: http://www.php-developer.org/wp-content/uploads/tutorials/opensourceidcreator.zip
blog comments powered by Disqus