Home arrow PHP arrow Page 3 - Create Picture IDs with Name Tags Using PHP

Demo Project Implementation - PHP

PHP can be used to write text to images or even merge a source image to a target image. With this concept, it is possible to create open source ID creation software. The ID can contain a picture of a person and a name tag written in text (or even include an ID number). Keep reading to learn how this can be done.

  1. Create Picture IDs with Name Tags Using PHP
  2. PHP Script to Write Text and Merge Images
  3. Demo Project Implementation
By: Codex-M
Rating: starstarstarstarstar / 6
July 13, 2010

print this article



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:

http://www.myphpprojectdomain.com/opensourceprojectcreator/?name=Your Name&idnumber=121455

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:

name=John Doe


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 

>>> More PHP Articles          >>> More By Codex-M

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: