Results 1 to 9 of 9

Thread: printing in php

  1. #1
    Join Date
    May 2003
    Posts
    383
    Rep Power
    0

    Default printing in php

    I currently trying to use php to print information entered on a webpage, I have gotten it work from one location using a pc running windows 2000 and winxp professional, however at I unable to print from home or from my clients pc both running winxp.

    Also the printing feature works when been run from localhost on the local pc's but doesn't work when the pages are uploaded to the internet.

    Fatal error: Call to undefined function: printer_open()


  2. #2
    Join Date
    Jul 2002
    Posts
    818
    Rep Power
    0

    Default Re:printing in php

    Under windows, to have access to certain functions the dll file containing that function has to be included in the "php.ini" configuration file found under you Windows directory. Open the file and search for the line ";extension=php_printer.dll" and remove the semi-colon. This un-comments the line and enables it the next time php runs. This should now allow you to print under windows.

  3. #3
    Join Date
    May 2003
    Posts
    383
    Rep Power
    0

    Default Re:printing in php

    CKnight i have been doing that for a week now with not good result. I have altered the extensions directory path all ways possible using both / & \. I uncommented it and it worked fine on the 2 pc's I mention that can run print ok, it just doesn't work on my clients pc of my pc at home

  4. #4
    Join Date
    Jul 2002
    Posts
    818
    Rep Power
    0

    Default Re:printing in php

    First thing, let's first make sure that it's not a problem with your extensions path.

    Uncomment the line for the MSSQL extension and then make a call to the mssql_connect() function like so:

    mssql_connect("server", "login", "password"

    If you don't have access to an MSSQL server it doesn't matter.

    Just call that function and take note of the error that you get.

    Does it say it can't find the server or that there is no such function?

    If you get the latter then you'll need to continue modifying your configuration file until you have the paths correct. If it's the former, well, then you got issues.

    Anyhow, one step at a time. Run the test I've given you above and tell me the results.

  5. #5
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default Re:printing in php

    wait I must might be confused or something but are you trying to use php to print pages using the client's printer?
    Or are you using you client to print pages on the server's printer?

    (php only has control over the server's printer)

  6. #6
    Join Date
    May 2003
    Posts
    383
    Rep Power
    0

    Default Re:printing in php

    i have the client running apache on his server and I'm trying to print to his printer which he connected to the server.

    Uncommented mssql extension and got the same error which I have attached.

  7. #7
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default Re:printing in php

    I don't see the attachment. re-attach it

  8. #8
    Join Date
    Jul 2002
    Posts
    818
    Rep Power
    0

    Default Re:printing in php

    It would seem your extensions path is still incorrect. From the error message you received, it would seem that php is looking for the modules in the same directory as the executable. By default, php installs all module files in a sub directory called 'extensions'. Kepp modifying your php.ini file until you have the correct path.

    N.B. You can use the absolute path to the directory if that makes it easier. ie 'C:\php\extensions\'

  9. #9
    Join Date
    May 2003
    Posts
    383
    Rep Power
    0

    Default Re:printing in php

    I have switched from sending the info to a printer to creating a pdf file once theinfo is submitted.All is now working well.

    However does anyone know a good hosting company that supports the pdf functions of php?

Posting Permissions

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