...

View Full Version : Smart Card Reader with PHP



mkyle
05-02-2006, 10:35 PM
Hi,

the project I am working on would like to implement the use of a smart card reader to input data into a form field. (Insert card to reader and pass info contained on card to form field to query application database)Does anyone know how this can be done?

Thanks Martin:thumbsup:

ralph l mayo
05-02-2006, 10:41 PM
Depends on the interface to the hardware. PHP is almost certainly a bad choice for this unless the device is built for HTTP and you've already got a web server on the network. Java's probably got a majority market share on this kind of thing now, FWIW.

edit: Err, well, you're free to use PHP for the form but you'r still going to need some logic between to convert the data into something useable, eh? Maybe if javascript has access to the device's output it can use AJAX to post the id to the server and get back some XML from PHP/SQL describing the form contents.

firepages
05-02-2006, 11:20 PM
Dunno about smartcard readers but with barcode scanners and fingerprint scanners its easy, just focus on the form field and scan.

I suspect a reader is similar to this?

TH.Sharplet
10-31-2007, 06:26 PM
Dunno about smartcard readers but with barcode scanners and fingerprint scanners its easy, just focus on the form field and scan.

I suspect a reader is similar to this?
How do I add narrow (n) and wide (w) bars to the following code, as explained at the following URL, in order to create code 39 barcodes.

http://www.codeproject.com/bitmap/barcode1.asp?df=100&forumid=4090&exp=0&select=1905375


<?php
$rectangle_width = 2;
$rectangle_height = 20;

$image = imagecreatetruecolor(500, 182);
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image, 0, 0, 0);
imagefill($image, 0, 0, $white);

$find = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*');
$replace = array('00110000', '00110001', '00110010', '00110011', '00110100', '00110101', '00110110', '00110111', '00111000', '00111001', '00101010');

$string = '*1101*';
$textstring = str_replace($find, $replace, $string);

$j = 0;
$sarray = str_split($textstring, 1);
for($i = 0; $i < count($sarray); $i++)
{
if($sarray[$i] == '0')
{
imagefilledrectangle($image, $rectangle_width * $j, 0, ($rectangle_width * $j) + $rectangle_width, $rectangle_height, $white);
$j++;

}
elseif($sarray[$i] == '1')
{
imagefilledrectangle($image, $rectangle_width * $j, 0, ($rectangle_width * $j) + $rectangle_width, $rectangle_height, $black);
$j++;
}
}

header("Content-type: image/jpeg");
imagejpeg($image);
imagedestroy($image);
?>

mlseim
10-31-2007, 06:33 PM
Why not use a 39 Code True Type Font?

CFMaBiSmAd
10-31-2007, 06:53 PM
Please don't hijack other threads by posting your questions in them, especially since you have an existing thread - http://www.codingforums.com/showthread.php?t=125913. Also, this current thread does not have anything to do with your question of generating bar codes.

Have you researched how the wide/narrow/quiet zone should be generated? I don't see any logic in your code that puts in a quiet zone between characters.

Continue your question in your own existing thread please.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum