BarCode reader

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kanaps
Forum Newbie
Posts: 13
Joined: Tue Nov 23, 2004 9:23 am
Location: UK
Contact:

BarCode reader

Post by kanaps »

what technology or how can I connect BarCode reader to php code/page?

Please HELP

Thank you,
Kanaps
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

My company has a setup where a barcode reader and a keyboard go into a box - that box is plugged into the keyboard jack of a computer. When a barcode is read in, it just goes up on the screen, as if it were typed in on the keyboard. From there, it's simple to make sure the cursor is in an HTML form and submit that to a PHP page.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
kanaps
Forum Newbie
Posts: 13
Joined: Tue Nov 23, 2004 9:23 am
Location: UK
Contact:

I see

Post by kanaps »

So you mean it is reasonable to have a text/password box and when someone scans the cards the number will go in there and then you press SUBMIT and it will happen.....
Is theres any other better ways of doin it?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

You might even be able to streamline it a bit more. I think our setup detects the number of characters entered into the field, and when there are 10 or so characters, the form is automatically submitted. So, all that needs to be done is scan the barcode, and the page takes care of the rest.

Is this for a point of sale system or some sort of card reader setup?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
kanaps
Forum Newbie
Posts: 13
Joined: Tue Nov 23, 2004 9:23 am
Location: UK
Contact:

Post by kanaps »

this is for login system. every one will be able to scan the plastic card (but they do not have a keyboard or mouse.. only touch screen and barcode scaner.

Hm.. interesting.
How they did that when it gets to 10(or something) it submits.... Java Script? Have you got any ideas?

Thank you for your help.. it is usefull.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Well, I think there is a Javascript condition called onKeyPress(). You can have that handler tied to an input text field, and have that call a function. That function can check the length of the string in the calling textfield, and submit the form if it's long enough:

Code: Select all

function checkLength()
{
     var length = get_value_of_calling_field();
     if(length == 10)
     {
          submit_form();
     }
}
...
<input type = "text" name = "barcode" onKeyPress = "checkLength(this)">
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
kanaps
Forum Newbie
Posts: 13
Joined: Tue Nov 23, 2004 9:23 am
Location: UK
Contact:

Post by kanaps »

OK!
Thank you, I think it will work. If something, I'll come back to it.
Thanks
Kanaps :D
Post Reply