I have this print style sheet switcher i created a long time ago and know it wont work for some reason, its suppose to switch to a print style sheet when the link is clicked and display the print dialog box.
But know it will only display the dialog box in FireFox and not in any other browser and will not display the print style sheet at all. Can some one help me fix these problems as its been a while since I played around with PHP.
Here is the PHP code.
<!-- Print Script -->
<?php if (isset($_GET['css']) && $_GET['css'] == 'print') { ?>
<meta name="robots" content="noindex" />
<link rel="stylesheet" type="text/css" href="http://localhost/styles/print.css" media="print" />
<script type="text/javascript">
//<![CDATA[
onload = print;
//]]>
</script>
<?php } else { ?>
<link rel="stylesheet" type="text/css" href="http://localhost/styles/style.css" media="screen" />
<?php } ?>
<!-- End Print Script -->
And here is the link you click to change the style sheet.
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?css=print" id="print-page" title="Print Link">Print This Page</a>