This topic is locked

Need a link to printer friendly page from view page

6/30/2008 10:55:44 AM
PHPRunner General questions
S
SJWilson author

I need to put a link to the printer friendly page on the view page.
<a href="_articles_print.php"> takes me to the right page but it displays all the records. How can I create a link on the view page that will show me the printer friendly page just for the record that is currently displayed?

J
Jane 7/1/2008

Hi,
try to use this link:

<A href="_articles_print.php?a=delete&amp;mdelete[]=1&amp;mdelete1[]={$show_RecordID}" target=_blank>View Printer-friendly page</A>



where RecordID is your actual field name.

S
SJWilson author 7/1/2008

Darn, it's not working. It opens the printer friendly page and shows just the header and footer but no record.
I think the field name I want here is ID. That is my primary key field in the articles table. It's also the auto-increment field. The link looks like this:
<a href="_article_list_print.php?a=delete&amp;mdelete[]=1&amp;mdelete1[]={$show_ID}">
Did I do something wrong?

J
Jane 7/2/2008

Hi,
make sure your URL is correct. Also if ID field is removed on the view page use following code:

<a href="_article_print.php?a=delete&amp;mdelete[]=1&amp;mdelete1[]={$show_key1}">Print</a>

S
SJWilson author 7/2/2008

Hi,

make sure your URL is correct. Also if ID field is removed on the view page use following code:


Dang, still not working. It just opens the print page with the header and the footer but no article in between. I think the URL is correct:

http://www.ilanamercer.com/phprunner/publi...ete&mdelete[]=1&mdelete1[]={$show_key1}
because if you go to the first part, like this:

http://www.ilanamercer.com/phprunner/publi..._list_print.php
it shows the full list.

J
Jane 7/2/2008

Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.

S
SJWilson author 7/2/2008

Ok, project uploaded and email sent. Thanks Jane.

P
pengas 8/6/2008

Hi,

make sure your URL is correct. Also if ID field is removed on the view page use following code:


Hi jane,
Can this be done in the same fashion for exporting?
I tried Database_export.php?a=delete&amp;mdelete[]=1&amp;mdelete1[]={$show_ID}
But that did not work.

J
Jane 8/7/2008

Hi,
you can use following link:

Database_export.php?editid1={$show_ID}


Then check $_REQUEST["editid1"] variable in the Export page: before SQL query event and add where clause to the SQL query:

if (@$_REQUEST["editid1"])

$strWhereClause = whereAdd($strWhereClause,"ID=".$_REQUEST["editid1"]);