Page 1 of 1

barcode reading

Posted: Thu Aug 09, 2007 8:13 am
by aceconcepts
Hi,

Does anyone know anything about barcode reading?

My objective is to be able to read a barcode and retrieve related data from a database.

Thanks.

Posted: Thu Aug 09, 2007 8:18 am
by thiscatis
http://www.ashberg.de/php-barcode/

might be a start, for reading them however I think you'll def. need some hardware interaction ;)

Posted: Thu Aug 09, 2007 8:41 am
by aceconcepts
Thanks for your reply.

I've already visited that site - very good.

I was wondering how I would go about "getting" the barcode value and using it to query a database (assuming I have the hardware).

Posted: Thu Aug 09, 2007 10:54 am
by RobertGonzalez
That is a cool little application. Did you see the part where you can upload in image of a barcode and it reads the data on it? That was really cool.

Posted: Thu Aug 09, 2007 11:02 am
by iknownothing
aceconcepts wrote:I was wondering how I would go about "getting" the barcode value and using it to query a database (assuming I have the hardware).
I would suggest something like a unique id, of maybe 6 numbers being inputted into the database on sign-up. Then perhaps use that application posted above for the image creation on request (UPC looks OK). That way, everything relating to PHP, will use the 6 digit ID, and only the barcode scanner will read the image (which then, essentially is converting the image back into the number anyway).

I would wait until you get the hardware until you (obviously talk to the salesman about what you want, hopefully he/she has half a brain) worry about querying the database, as I'd assume that the number if what would come from the hardware anyway.

Posted: Thu Aug 09, 2007 11:21 am
by aceconcepts
Yeah the upload app is very cool.

Thanks for the post iknownothing, I was thinking of doing something like a longer unique id when people sign up, thus keeping things "php-simple" :D .

I don't have the hardware yet but how does it work when you scan a barcode? How would one "get" the image scanned?

What I mean is how does the scanner communicate with a php script to retrieve the image/barcode?

I think i'm making sense

Thanks. :D

Posted: Thu Aug 09, 2007 11:29 am
by VladSun
I am not sure that PHP is the best choice for doing this. Maybe C, Perl or other not so www oriented language.

Please, let me beeing excused for this suggestion :)

Posted: Thu Aug 09, 2007 1:53 pm
by alex.barylski
As far as I can remember (look into barcode readers, they have info on this) barcode scanners simply emulate keyboard strokes.

When you scan a barcode, relavent characters should be entered into the currently selected textbox. Which you can then POST to a PHP script. Not sure if reading a barcode from PHP is really nessecary.

Posted: Thu Aug 09, 2007 4:25 pm
by timvw
I can confirm that hardware barcode readers do return a regular string with data ;) (like a keyboard as hockey mentionned) You'll probably find lots of barcode recognition software too..


(Even i was able to create a very, very, very basic Code39 scanner (using c#) in less than an afternoon)