Hi,
Using PHP, is it possible to create a Barcode Login System, where user scan a Barcode using a Barcode Reader in-order to logon?
If possible, how would I go about creating this?
| SitePoint Sponsor |


Hi,
Using PHP, is it possible to create a Barcode Login System, where user scan a Barcode using a Barcode Reader in-order to logon?
If possible, how would I go about creating this?
Not with php alone. If you find a barcode reader program, you can have php communicate with it.
Saul
Maybe editing and compiling something like this http://www.codeproject.com/useritems/includeh10.asp into a dll/so php library then loading it into php (dl) and using it to read the barcode image.





Most of the barcode scanners i've used, when scanning a barcode it simply types out the value of the barcode and presses enter. ie in Word scan the barcode and it will type out the barcode value and go to the next line.
I have used this PHP barcode code before. Works well.
http://www.mribti.com/barcode/








handbags at dawn.


Hi,
Does anybody know where I can get an automatic Barcode Scanner from, like at Tesco's for example, where you can just put the Barcode in front of the scanner and it scans without have to press a trigger?
Do they have a special name?
What would I search for on eBay?





most scanners will allow you to enable this function. Have you got a scanner already?


Know but I have just purchased one on eBay. Click the link below to view
http://cgi.ebay.co.uk/ws/eBayISAPI.d...MEWN:IT&ih=007





If you can find out the manufacturer and model no, you might be able to find out some further information regarding having it always on.
What are you exactly trying to do make a shop with a scanner to send the data to a mySql or something?


Hi,
Using PHP, is it possible to create Bar Codes on the fly. Using an ID as the actual Bar Code?



Yes, documentation @ :
http://pear.php.net/package/Image_Barcode/
Computers and Fire ...
In the hands of the inexperienced or uneducated,
the results can be disastrous.
While the professional can tame, master even conquer.


byron3@earthlink,
Is there anyway only PHP can be used to create the BarCodes, along with divs, for the bars?
Many Thanks, much appreciated!!!


have a play with:
This uses pure css to display the bars. If you needed something with different bars for each number, use a background image instead of a colour.PHP Code:<style type="text/css">
.bar_container { width: 5px; height: 150px; text-align: left; float: left; margin:1px;}
.b1 { width: 1px; height: 150px; background: #000000; float: left; }
.b2 { width: 2px; height: 150px; background: #000000; float: left; }
.b3 { width: 3px; height: 150px; background: #000000; float: left; }
.b4 { width: 4px; height: 150px; background: #000000; float: left; }
.b5 { width: 5px; height: 150px; background: #000000; float: left; }
.b6 { width: 6px; height: 150px; background: #000000; float: left; }
.b7 { width: 7px; height: 150px; background: #000000; float: left; }
.b8 { width: 8px; height: 150px; background: #000000; float: left; }
.b9 { width: 9px; height: 150px; background: #000000; float: left; }
.b10 { width: 10px; height: 150px; background: #000000; float: left; }
</style>
<?php
$bar_array = array(
0 => 1,
1 => 2,
2 => 3,
3 => 4,
4 => 5,
5 => 6,
6 => 7,
7 => 8,
8 => 9,
9 => 10
);
$bar_string = "09916554020009";
$bar_length = strlen($bar_string);
for($i=0; $i<=$bar_length; $i++) {
if(array_key_exists($bar_string{$i}, $bar_array)){
echo '
<div class="bar_container">
<div class="b'. $bar_array[$bar_string{$i}] .'"></div>
</div>
';
}
}
?>
Mike Swiffin - Community Team Leader
Only a woman can read between the lines of a one word answer.....
I started out with nothing... and still got most of it left!


tinkered a bit - so now it's a function....
PHP Code:<style type="text/css">
.bar_container { width: 5px; height: 150px; text-align: left; float: left; margin:1px;}
.b1 { width: 1px; height: 150px; background: #000000; float: left; }
.b2 { width: 2px; height: 150px; background: #000000; float: left; }
.b3 { width: 3px; height: 150px; background: #000000; float: left; }
.b4 { width: 4px; height: 150px; background: #000000; float: left; }
.b5 { width: 5px; height: 150px; background: #000000; float: left; }
.b6 { width: 6px; height: 150px; background: #000000; float: left; }
.b7 { width: 7px; height: 150px; background: #000000; float: left; }
.b8 { width: 8px; height: 150px; background: #000000; float: left; }
.b9 { width: 9px; height: 150px; background: #000000; float: left; }
.b10 { width: 10px; height: 150px; background: #000000; float: left; }
</style>
<?php
function generate_barcode($code) {
$bar_array = array(
0 => 1,
1 => 2,
2 => 3,
3 => 4,
4 => 5,
5 => 6,
6 => 7,
7 => 8,
8 => 9,
9 => 10
);
$bar_length = strlen($code);
$display = '';
for($i=0; $i<=$bar_length; $i++) {
$display .= '
<div class="bar_container">
<div class="b'. $bar_array[$code{$i}] .'"></div>
</div>
';
}
return $display;
}
echo generate_barcode("09916554020009");
?>
Mike Swiffin - Community Team Leader
Only a woman can read between the lines of a one word answer.....
I started out with nothing... and still got most of it left!


Hiya Folks,
I currently have a USB barcode reader, is there anyway scan-able barcodes can be created using PHP and CSS Divs?


Hiya Folks,
I currently have a USB barcode reader, is there anyway scan-able barcodes can be created using PHP and CSS Divs?
barcodes are just text using a special barcode font (a39 or something, I cant quite remember).
So when a barcode is scanned, the scanner acts as a keyboard, and simply returns a string of characters to your page.
If you want to display a barcode, then either every user of the sites needs to have the barcode font you are using downloaded locally, OR you need to provide the barcode as a graphic (which will be easy to create in GD).
etones
http://www.e-tones.co.uk - FREE Resources for your mobile phone





maybe with flash...
★ James Padolsey
–––––––––––––––––––––––––––––––––––––––
Awesome JavaScript Zoomer (demo here)
'Ajaxy' - Ajax integration solution (demo here)
http://www.barcodesinc.com/free-barcode-font/
Just a font but should work depending on the type of reader you have maybe.


I've already tried the fonts found at: http://www.barcodesinc.com/free-barcode-font/ they don't work.
Is there anyway of dynamically making on-the-fly barcodes, using Divs?





Try the class found here - it supports several different standard encodings, your reader should be able to read at least one of them. The barcodes are generated as images using GD, so there's no need for your users to have special barcode fonts and you can be sure they'll show up the same way on everyone's screen/printer.
Edit:
Just found this one on PHP Classes that seems to support more encodings and has more features over all.
Bookmarks