SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Dec 2008
    Location
    Melbourne, Australia
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mixing HTML and PHP to printer

    Hi Guys,
    I am new to all this stuff.
    I have created a form which updates a mysql database.
    I also have a php script that generates a report. The php script does a 'select' on the database using the primary ID field auto generated by the database update.
    What I want to do is PRINT out the report as the last action of the form submission. I also want to add 2 additional text or html documents into the print out.
    What the whole process does is (1) Complete a hire form, (2) Update the relevant tables in mysql (3) Query a view to print out a Hire Agreement and include in that hire agreement a 'terms and conditions' and 'instruction sheet'.

    My question are;
    In the action script that does the update, how do I run the php script that generates the report.
    Secondly, how do I include the 'terms' and 'instructions' into the displayed report.
    And lastly, Can I send the report, terms and instructions directly to the printer without displaying them in the browser first.

    Garry

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cookeg View Post
    In the action script that does the update, how do I run the php script that generates the report.
    you simply put some code into the file. Maybe you want to use include()
    Quote Originally Posted by cookeg View Post
    Secondly, how do I include the 'terms' and 'instructions' into the displayed report.
    See above.
    Quote Originally Posted by cookeg View Post
    And lastly, Can I send the report, terms and instructions directly to the printer without displaying them in the browser first.
    Assuming you want this to print on the clients computer, you should reconsider. Give them a button and let them print when they're ready. You can bring up thier print window by using javascript window.print(). You can use css to alter the display of what will be printed vs what will be shown. Search for css media print.


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
  •