Reputation: 20444
I am setting up a separate theme page for printable content. To tell the browser to use the print theme I'm using a mark ?print after the URL. So how does one get that content?
Something link
<?php if (? = 'print') {
blah blah }
Any ideas?
Marvellous
Upvotes: 1
Views: 5761
Reputation: 1172
Are you aware you can just set up a stylesheet for printing, this may suffice for your needs. Just add a line like the following after your standard css line.
<link rel="stylesheet" href="print.css" type="text/css" media="print" />
Upvotes: -2
Reputation: 318518
You can access the whole query string using $_SERVER['QUERY_STRING']
.
So your code could look like this:
if($_SERVER['QUERY_STRING'] == 'print') { /* do something */ }
Upvotes: 3
Reputation: 490283
You use $_GET
array to access that.
If you want the whole string, use $_SERVER['QUERY_STRING']
.
In your example, you'd do something like this...
if (isset($_GET['print'])) {
// something.php?print
};
Upvotes: 0