This topic is locked
[SOLVED]

 Print redirect

9/25/2011 4:47:41 AM
PHPRunner General questions
S
seanbull81 author

Hi,
I have two projects, A and B. I want to redirect A's print selected button to B's _print.php. anyone tells me how to do this?
meanwhile, i would like to add a print button on A's _view.php page to B's _print.php page. when i put ?editid1=key, it will show all the records in the list page. anyone tells me how to resolve this? thanks.
Sean

C
cgphp 9/25/2011

To redirect from A to B, paste the following code in the javascript OnLoad event of the List page:

$("input[type='button'][value='Print selected']").click(function(e)

{

location.href = 'http://path/to/the/B/print/page';;

});
S
seanbull81 author 9/26/2011

thanks Cristian. but seems the new page won't accept any value from editid1. no matter what number i put after, the print page will show all records there.
i also tried to change the value of $record["printselectedlink_attrs"] to the new page but it didn't work. however, $record["editlink_attrs"] works fine. any idea? thanks again.

C
cgphp 9/26/2011

You can set a parameter in the URL like this:

http://path/to/the/B/page?q=13



In the "Print page: Before SQL query" event of the B page, enter this code:

$strWhereClause = "id=".$_GET['q'];



where id is the primary key of the table.