> -----Original Message----- > From: Sebastian [mailto:[EMAIL PROTECTED] > Sent: 15 March 2003 06:23 > > > doesn't work but also doesn't give any errors, I will try to > explain what I > am trying to do: > > I am trying to remove the header and footer to create a > "printer friendly > page" with just the content, here's what my pages look like, I need to > remove header and footer when they visit: file.php?action=print > > <?php > include("../config.php"); > > if($_GET[action] == "print") > { > $header = str_replace('include("$header");', '', $header); > $footer = str_replace('include("$footer");', '', $footer); > } > > include("$header"); > ?> > > // html > > <?php include("$footer"); ?>
Well, on the whole, if you don't want to do something based on a particular condition, then -- er -- just don't do it: <?php include("../config.php"); if(!$_GET[action] == "print") { include("$header"); } ?> // html <?php if(!$_GET[action] == "print") { include("$footer"); } ?> Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php