Problem with printer-friendly page

3 posts by 2 authors in: Forums > CMS Builder
Last Post: December 12, 2013   (RSS)

Hi, All.

I'd like to link to a printer-friendly page from the "full" version, but I get a "Record not found" error message.

Here's the index page: http://www.newhamburg.ca/offers.php

This is an example of a "full" page: http://www.newhamburg.ca/offersDetails.php?Common-Sense-Design-1

The template for the printer-friendly version is here: http://www.newhamburg.ca/offersDetailsPrint.php

The code I'm using to link to the printer-friendly page from the full version is as follows:

<a href="http://www.newhamburg.ca/offersDetailsPrint.php?<?php echo $record['num'] ?>">Print this voucher</a>

Can anyone see where I'm going wrong, please?

By Dave - December 12, 2013

Hi Nigel, 

You need a ?1 after /offersDetailsPrint.php.  

My first guess is maybe your record variable isn't named $record?  View-source on offersDetails.php?Common-Sense-Design-1 and see if there are any PHP errors, or try <?php showme($record); ?> to see all the variables that are available.  

Or if you know that you always want the link to your printer page to have the exact same query string as your detail page then you could just do this (untested):

<a href="http://www.newhamburg.ca/offersDetailsPrint.php?<?php echo $_SERVER['QUERY_STRING']; ?>">Print this voucher</a>

Hope that helps!  Let me know if any of that does the trick for you.

Dave Edis - Senior Developer
interactivetools.com