473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Reading Bar Code Scanner

I will be starting to work on an e-commerce web site pretty soon, and
one thing the user would like to do is to have a part of the site that
he could use in the store for recording the transaction. To accommodate
this, our (myself and the other programmer) thought was to use a bar
code scanner to get the product info into the system to cut down on
errors and save time. However, I'm not sure if this is doable. Is it
possible with PHP to have a page up and then scan the article, and have
the bar code passed to the script so it can query the database and bring
up the item on the page? I know the script has to be called by
something, but I'm not sure exactly what could be used.

Thanks.

Steve
Jul 17 '05 #1
3 7444

"Steve" <ra***********@hotmail.com> wrote in message
news:J%lcd.194856$wV.85898@attbi_s54...
I will be starting to work on an e-commerce web site pretty soon, and
one thing the user would like to do is to have a part of the site that
he could use in the store for recording the transaction. To accommodate
this, our (myself and the other programmer) thought was to use a bar
code scanner to get the product info into the system to cut down on
errors and save time. However, I'm not sure if this is doable. Is it
possible with PHP to have a page up and then scan the article, and have
the bar code passed to the script so it can query the database and bring
up the item on the page? I know the script has to be called by
something, but I'm not sure exactly what could be used.

Thanks.

Steve


Yes, it is possible. A bar code scanner is just a glorified keyboard.
Anywhere you can type data in, you can scan a bar code and the date will
show up just like it was typed. One caveat - make sure you get a scanner
that has built in decoding - meaning it translates what is scanned into
useable data.

Now, if you want to scan and have something automatically happen...

Most bar code scanners allow you to program (usually by scanning a special
bar code that is in the manual) a "post-amble" character. You would set
this to a LF/CR (Enter). Then when you scanned on the field the data would
be entered and prepended with an Enter. The default button on the form
should be the submit button.

So you would scan the value, the data would be entered and the "submit form"
button selected would be processed and the data would be passed to your form
(php script) to do whatever you needed to do with it.

Note: You can also set your post-amble character to be a "tab" so it will
go to the next field instead of the enter key.

Hope that helps...
Jul 17 '05 #2
Steve wrote:
To accommodate this, our (myself and the other programmer) thought was to use a bar
code scanner to get the product info into the system to cut down on
errors and save time.


Just in case you're forging ahead under a misconception, barcodes don't
actually store information about the product they're on. They simply
contain numbers (or sometimes alphanumeric characters, in the case of
Code 39 for example) which refer to product details already stored in a
database of some sort. This means that you're not going to have a magic
time-saving solution to putting information into the system in the first
place.

Apologies if that's obvious!

I've used barcodes in a small library system written in PHP, and printed
them using FPDF - available at http://www.fpdf.org. There are some neat
extension classes to create labels, too.

For actually creating barcodes in PHP, you might want to have a look at:

http://www.mribti.com/barcode/

http://www.ashberg.de/php-barcode/

Ed

Jul 17 '05 #3
It really depends on the barcode... A lot of times the numbers are
codes for categories... For insatnce the number (alphanumeric and
integers) could translate into other meanings.

Just for example of what I am talking about at my work we use barcodes
to find information, the bar code is written in such a way that you can
find the day, year, and unique number for the piece of information you
are looking for.

We use Julian dates where I work (day of the year numerically), the
bar-coded numbers look like: 20042922-0122300, and what that translates
to is 2004 (year) 292 (the numeric date for today) 2 (a sorting number
we use to classify data) and then 0122300 (a unique number for the
information) but the bar codes can even be coded to mean anything.
EX: 11=large 12=small 13=medium 14=custom size, etc..

That is a bad example of how it may be, but what I am getting at is
that he may be able to develop a bar-code system that uses numeric
feilds to define attributes of whatever he is doing, and in that case
the PHP script would be able to translate those fields into useable
information which is then stored in the database, and would then save
him a bunch of time... Coding would take longer, but be better for the
customer by a long shot.

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike Smith | last post by:
Can i have a web application to interact with a bar code scanner attached to the clients pc ? Would i have to download some form of active-x component to do so ? or would the scanner just be like a...
3
by: gilles_perreault | last post by:
I'm trying to use the scanner on these units. Has anyone done this ? Thanks for your lights. *-----------------------* Posted at: www.GroupSrv.com *-----------------------*
4
by: Gerry19 | last post by:
Hi All, I'm trying to monitor data passed from a USB Barcode scanner but I can't find any decent code examples of what I need to do, including any references I need to include. I know I need to...
11
by: mbrigdan | last post by:
What I am trying to do is to create a very basic A-life simulator. What I can't figure out is how to read and execute C++ code from a file, if I could do this it would be simple to make custom...
6
Ali Rizwan
by: Ali Rizwan | last post by:
Hi all, I want to make a programe which reads a bar code and also create bar codes(Optional). Input is taken from bar code scanner and may be the simple scanner. In case of simple scanner programe...
1
by: pfm721 | last post by:
I can read and follow most code. However I am having trouble borrowing code from another database. it is working correctly but so that I can understand what is going on I need someone to tell me what...
11
by: ianoble | last post by:
I've been trying to piece together various code snippets to create a lookup table inside my xslt without the need for a supplemental xml file. Here is what I have so far. As of now, it does not...
2
by: Coreyja | last post by:
I am new to Java and would greatly appreciate any help. Here is some code I am working on as basically a proof of concept. I am using a "throws FileNot FoundException". The problem is that when i run...
7
by: padavalanaresh | last post by:
Please tell me the process of integrating barcode scanner with the asp.net application in brief,where i need to generate barcode images and read the barcode and store im my database..... I am not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.