Dear all,

i need to create an application in which i have to read bar code reader for a product and then save the extracted information in the mysql database.

I want to know the procedure to do it. also i don't have bar code scanner, so is there any way to simulate bar code reading process for testing purpose.

pl help me to complete the task soon.

    It's not clear what you're doing. Are you saying you want to be able to upload an image to a PHP script, have it locate and read a barcode in that image, and then do something with that information? Or are you instead asking how to take a normal barcode reader (e.g. a physical handheld device) and use information from scanned barcodes?

      6 days later

      I have done something I think similar to what you are trying to do, maybe. Here's the way it worked:

      The barcode reader and its software took care of scanning the barcode with a laser and converting those crazy bars into numbers.

      The barcode reader ran Windows mobile and ran a version of Internet Explorer.

      So the user would start Explorer, navigate to what really was just a regular php page with a form with fields like "barcode", etc. The user placed focus on the input field on the form where they want the barcode to be entered. The user could then scan the barcode and the software on the scanner took care of putting the numbers into the form.

      On the PHP side there is nothing different than using regular old forms. The barcode scanning and interpretation is done on the scanner by the scanning software. Collecting the form info and storing it in the database is just as you would do normally with PHP. PHP doesn't know there even is a barcode scanner involved, so for testing you can just type numbers into the form.

      You can even turn the barcode data (numeric string) back into a barcode using PHP. Maybe with Jpgraph? I don't remember what library I used.

      The barcode reader used for this was a Motorola Symbol device (model 9090 I think).

        Thanks for replies.

        I would like to clear the problem,

        I have created an Inventory Management system in php. Now i need to
        integrate bar code functionality in it.
        From admin side, admin would be able to add inventory using bar code.

        I came to know that when user scans barcode using come barcode scanner, decoded value will come in selected input box. And then use of that value is depends on us.

        My questions are,

        1. How to know whcih type of barcode is used in the product using php? so that we will work on the decoded value?

        2. How set enter key operation or carriage return in scanner?

        3. How can i simulate the whole process as i am not having barcode reader and i would like to create script first?

        4. i didnt find any script/code to scan barcode using net. How i would be able to do it? i got some script to generate barcodes using barcode types etc.

        I short, i need a script which can take barcode value and analyze it to get information from it.

        please help,
        it may be helpful for others too.

        Thanks in advance.

        • Prashant

          How to identify scanned bar code is of which type like EAN, c-39 ETC?

          As i came to know that, when user scans a bar code using barcode reader, php page will take decoded value. But then we will have to work on that value. For that we must know scanned barcode's type.

          pl help

            Either you don't understand how barcode readers work, or you're talking about something entirely different.

            The actual hardware you use to scan the barcode reader will decode the bars into a string of ASCII characters and transmit those characters to your computer, often followed by an Enter/Return simulated keypress.

            In other words, there is no difference between scanning a barcode and typing in the numbers on your keyboard. The result is the same.

              peashant_st;10958089 wrote:

              1. How to know whcih type of barcode is used in the product using php? so that we will work on the decoded value?

              The software on the scanner figured out what type of barcode it was (EAN-13, etc). On the scanner I used we could configure settings for each bar code type. I seem to recall somehow even short barcodes (7-digit?) were translated to be the same number of digits in the database but I don't remember if the scanner figured that out, or if I did something w/ PHP. I think the scanner handled it.

              peashant_st;10958089 wrote:

              2. How set enter key operation or carriage return in scanner?

              Not sure exactly what you're asking here. The scanner should have some button that is the equivalent of "enter'. We set also configured the scanner software to send a tab character after each barcode so focus on the form would go to the next input after the barcode was scanned.

              peashant_st;10958089 wrote:

              3. How can i simulate the whole process as i am not having barcode reader and i would like to create script first?

              Just create the inventory management code with the forms and enter values by hand.

                jazz_snob;10958100 wrote:

                The software on the scanner figured out what type of barcode it was (EAN-13, etc). On the scanner I used we could configure settings for each bar code type. I seem to recall somehow even short barcodes (7-digit?) were translated to be the same number of digits in the database but I don't remember if the scanner figured that out, or if I did something w/ PHP. I think the scanner handled it.

                OK i am satisfied with your answers, Please tell me,

                Scanner will figure out the batcode type. Suppose first reads EAN type of code with 12-13 digits and for another product/item it reads C-39 type of code. Barcode scanner is reading correctly and giving us decoded code. But how we will find out given code is of which type. By counting the digits of decoded value is not a good idea.

                  I our situation the inventory was already in the warehouse and we were given a spread sheet that contained the barcode and product information (one record in each row). The spreadsheet had every barcode as 11 digits (yes, I said 11, they probably should have been 12 but I think they dropped the check digit), whereas the barcodes on the items came in a variety of formats.

                  So my question to you is, why do you care what barcode encoding is used? In our case I believe we used the scanner to convert all scanned codes to a single code format and we those digits to match our items to records in the database. So for my project it didn't matter what the barcode format was because the scanner always translated it into the correct number of digits to match our records in the database.

                    Write a Reply...