I am working on an application that produces receipts and invoices. So I need a php code that will enable me to print these items directly to my printer without printing the whole web page. Please soomeone help.
Are you wanting the print dialog to come up in a browser or be sent to the printer? What OS are you running?
You don't need php for this. Use a print css file that will display:none the areas of the page you don't want so they won't be printed out. You can invoke the print dialogue in javascript onclick of a button, window.print() I think eg : <input type="button" onclick="javascript:window.print();" value="Pint your receipt" /> HTML: Example print.css : div#header, div#sidebar, div#footer {display:none;} Code (markup): To include the print.css in your html : <link rel="stylesheet" type="text/css" href="print.css" media="print" /> HTML: