glenelkins Posted September 29, 2006 Share Posted September 29, 2006 HiNever actually had to do this before. I have setup a script to send an email out containing some information. as such[code]$body = "<body bgcolor='#23972C'><font face='Verdana' size='2' color='white'>"; $body .= "Hello " . $name . ",<br><br>"; $body .= "Following is the information on one of our properties you requested.<br><br>"; $body .= "Kind Regards<br>"; $body .= "Connaught Estates<br><a href='http://www.connaughtestates.com'>http://www.connaughtestates.com</a><br><hr width = '50%' color='white' align='left' height='1px'><br><b>" . $title . "</b><br>"; $body .= $image . "<br><b>£" . $price . " " . $type . "<font color='black'> " . $status . "</font>"; $body .= "<br><br>Address: </b>" . $address . "<br><b>Area: </b>" . $area; $body .= "<br><br><b>Rental/Purchase: </b>" . $rentalorpurchase; if ($rentalperiod != "") { $body .= "<br><b>Rental Period: </b>" . $rentalperiod; } $body .= "<br><b>Bedrooms: </b>" . $bedrooms . "<br><b>Bathrooms: </b>" . $bathrooms; $body .= "<br><br>" . $fulldescription; $body .= "</font></body>";[/code]How would i get PHP to actually print this (to a printer) so that it prints the information and not the code itself? Link to comment https://forums.phpfreaks.com/topic/22502-printing-in-php/ Share on other sites More sharing options...
glenelkins Posted September 29, 2006 Author Share Posted September 29, 2006 - Link to comment https://forums.phpfreaks.com/topic/22502-printing-in-php/#findComment-100919 Share on other sites More sharing options...
ToonMariner Posted September 29, 2006 Share Posted September 29, 2006 you can't - the only thing you coudl do is use the javascript window.print(); command on the onload event of the body. This would need the users email agent to support js. Same could be done on a normal web page - BUT I would be very annoyed at something trying to print automatically without my input. I don't want to see warnings that I have tried to print when my printer is off - or that I have been charged 5p for printing something I didn't request when I am using a cluster and have to pay for printing....I just don't want anything to print out automatically - I want control and that is teh case for the vast majority of users on the web. Link to comment https://forums.phpfreaks.com/topic/22502-printing-in-php/#findComment-100943 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.