SitePoint Sponsor

User Tag List

Page 1 of 4 1234 LastLast
Results 1 to 25 of 89

Thread: Create Barcodes

  1. #1
    Non-Member
    Join Date
    Aug 2007
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create Barcodes

    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?

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Not with php alone. If you find a barcode reader program, you can have php communicate with it.
    Saul

  3. #3
    SitePoint Enthusiast Cborrow's Avatar
    Join Date
    Apr 2005
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.


  5. #5
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have used this PHP barcode code before. Works well.

    http://www.mribti.com/barcode/

  6. #6
    <?php while(!sleep()){code();} G.Schuster's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by karatechamp View Post
    I have used this PHP barcode code before. Works well.

    http://www.mribti.com/barcode/
    Ahem...please read the thread before you post.
    That class only generates images - it can't read it from a scanner.
    Topic failed, mark F, a teacher would say.

  7. #7
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    handbags at dawn.


  8. #8
    Non-Member
    Join Date
    Jun 2007
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Automatic BarCode Scanner

    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?

  9. #9
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    most scanners will allow you to enable this function. Have you got a scanner already?


  10. #10
    Non-Member
    Join Date
    Jun 2007
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  11. #11
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.


  12. #12
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What are you exactly trying to do make a shop with a scanner to send the data to a mySql or something?

  13. #13
    Non-Member
    Join Date
    Aug 2007
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create Barcodes

    Hi,

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

  14. #14
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    453
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Computers and Fire ...
    In the hands of the inexperienced or uneducated,
    the results can be disastrous.
    While the professional can tame, master even conquer.

  15. #15
    Non-Member
    Join Date
    Aug 2007
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create Barcodes

    byron3@earthlink,

    Is there anyway only PHP can be used to create the BarCodes, along with divs, for the bars?

    Many Thanks, much appreciated!!!

  16. #16
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    have a play with:
    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(
            
    => 1,
            
    => 2,
            
    => 3,
            
    => 4,
            
    => 5,
            
    => 6,
            
    => 7,
            
    => 8,
            
    => 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>
                '
    ;
        }


    ?>
    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.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  17. #17
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    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(
            
    => 1,
            
    => 2,
            
    => 3,
            
    => 4,
            
    => 5,
            
    => 6,
            
    => 7,
            
    => 8,
            
    => 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 Advisor
    Only a woman can read between the lines of a one word answer.....

  18. #18
    Non-Member
    Join Date
    Aug 2007
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create Code 25 Barcodes

    Hiya Folks,

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

  19. #19
    Non-Member
    Join Date
    Aug 2007
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JavaScript Barcode Creator

    Hiya Folks,

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

  20. #20
    SitePoint Enthusiast
    Join Date
    Nov 2000
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  21. #21
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    maybe with flash...
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  22. #22
    ャ.ャ shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    http://www.barcodesinc.com/free-barcode-font/
    Just a font but should work depending on the type of reader you have maybe.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  23. #23
    Non-Member
    Join Date
    Aug 2007
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  24. #24
    ャ.ャ shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TicTac View Post
    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?
    It would be a pain in the *** to do it that way.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  25. #25
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    PHP questions? RTFM
    MySQL questions? RTFM


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •