No offense, TCANIPE, but that code is just... bad.
Let me explain:
Most importantly, you NEVER put a $_POST variable (or any variable, for that matter) into a MySQL query without running it through mysql_real_escape_query, or something equivalent. It leaves you wide open for SQL Injection.
The way your PHP code is set up there, it will insert a row every time the page is shown, regardless of whether there is any data to insert. Which leaves you with a table full of empty serialnum values.
Your PHP code does an exit , which cuts the page off before the end of the HTML is shown.
The <form> element isn't complete. You just left it open and missing the action attribute.
Your submit button is labeled "Exit". (The one labeled "Insert record" is commented out ;P)
I don't mean to sound offensive tho. Just couldn't leave it untold.
How exactly does this relate to the OP's question anyways?
To the OP.
Sorry, I'm afraid I won't be of much use to you. I have no idea what virtuemart is, and I was never any good at dealing with hardware :)
A barcode is a graphical representation of string. All barcode readers take this graphic SCAN and convert it into a String for the computer to understand.Most automatically input it into the computer as the string had been typed on the keyboard. Additionally, most scanners come with the default set to append an ENTER or RETURN to the end of each barcode scanned. The process involves -
- Create an Form like <Input type=text name=barcode size=x>
- when a user scans a barcode the form will automatically be submitted provided that the barcode scanner is appending a RETURN or ENTER key
and then do whatever with it, like you can enter it into the database.
or else have a look here
by network18: Edit:submit error due to large traffic