Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PHP] how to have a print button on a PHP generated page

0 views
Skip to first unread message

Carlos Fernando Scheidecker Antunes

unread,
May 18, 2001, 3:00:32 PM5/18/01
to
Hello All!

I have a page that was generated by PHP4 and is the result of a query.

I would like to enable a button to have the page printed.

Does anyone knows how to do it with either PHP or javascript?

Thanks,

C.F.

jarek

unread,
May 18, 2001, 3:04:50 PM5/18/01
to
maybe this helps
:

<html>
<HTML>
<HEAD>

<script language="JavaScript">
<!--
function custom_print() {
if (document.all) {
if (navigator.appVersion.indexOf("5.0") == -1) {
var OLECMDID_PRINT = 6;
var OLECMDEXECOPT_DONTPROMPTUSER = 2;
var OLECMDEXECOPT_PROMPTUSER = 1;
var WebBrowser = "<OBJECT ID=\"WebBrowser1\" WIDTH=0
HEIGHT=0
CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>";
document.body.insertAdjacentHTML("beforeEnd", WebBrowser);
WebBrowser1.ExecWB(6, 2);
WebBrowser1.outerHTML = "";
} else {
self.print();
}
} else {
self.print();
}
}
//-->
</script>
</HEAD>
<BODY>
<div align="center">
<input type="submit" name="Submit" value="Print"
onClick="custom_print()">
</div>
</html>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general...@lists.php.net
For additional commands, e-mail: php-gene...@lists.php.net
To contact the list administrators, e-mail: php-lis...@lists.php.net

0 new messages