WEB Printing from PHP

Discussion in 'OT Technology' started by hurleyint1386, Jun 16, 2008.

  1. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    So I'd like to build a website for a company that will be generating custom invoices. I'd like to find some way for the user to log into the site, then print their invoice and have it print out... Sounds easy enough. Here's the kicker: I'm hosting it on one server, but I'd like everything to print to a network printer somewhere else. That way no matter where the person is, it prints to that same printer. Is there a way to send a print job to another networked printer using PHP? Obviously I would need to make sure that I have port forwarding configured with the router to accept the print jobs, which shouldn't be too difficult. It's just sending that job. If anyone has any ideas, please let me know. Thanks a lot. :wavey:
     
  2. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    in for answer
     
  3. Ricky

    Ricky █▄ █▄█ █▄ ▀█▄

    Joined:
    Jun 17, 2005
    Messages:
    38,767
    Likes Received:
    6
    i'd just make the users downlaod the file :o
     
  4. Ricky

    Ricky █▄ █▄█ █▄ ▀█▄

    Joined:
    Jun 17, 2005
    Messages:
    38,767
    Likes Received:
    6
    and print it to their mapped printer
     
  5. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    Well actually, it's my business that I'm writing it for. I just decided to make it more general. Myself, along with about 3 or 4 other people will be working on some stuff and printing it. I've got my networked printer in my house that I want it all to print on.
     
  6. 2ofdem

    2ofdem OT Supporter

    Joined:
    Jun 17, 2003
    Messages:
    114,854
    Likes Received:
    8
    Location:
    aus.vic.mel
    set up a webserver on the local lan to that printer and write a page that auto prints (you can do it in javascript) and use CURL to call that page from your main page whilst passing it the info it needs.
     
  7. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    Although that will probably work, there must be something else. I'm thinking I could exec a command to the command line and send a print job to a networked printer on a specific ip address. This might not be possible, but I'll probably look into it
     
  8. Ricky

    Ricky █▄ █▄█ █▄ ▀█▄

    Joined:
    Jun 17, 2005
    Messages:
    38,767
    Likes Received:
    6
    I'd be :noes: about doing that.

    Mainly cause i'd fuck up somehow and open up a security hole
     
  9. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    that's what I was thinking, but I'd have no idea how to do that
     
  10. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    I've worked with execs before and haven't had any issues. This won't be a very public website, and I plan on doing plenty of security measures to make sure no one is accessing the site with out proper authorization... but now that I think of it, I wonder if my hosting service even allows exec commands. I wouldn't be surprised. I suppose I could run the site through my server at my house, that way printing might be a little bit easier. I guess there are a few possible options, I just need to find out which one is the best
     

Share This Page