This topic is locked
[SOLVED]

  Prevent : 'Print this page' or 'Print all pa

9/8/2010 5:07:11 AM
PHPRunner General questions
N
netmedia59 author

Hello,
Is there a way to prevent 'Print this page' or 'Print all pages' ?

For example I want the only possibility of printing only one record :

  • POSSIBLE : dd_badges_print.php?editid1=46
  • IMPOSSIBLE : dd_badges_print.php or dd_badges_print.php?all=1
    Thanks very much
    Olivier

    Lille (FRANCE)

A
ann 9/8/2010

Olivier,
proceed to the Before display event on the Events tab and hide these links:

$xt->assign("printall_link", false);

$xt->assign("print_link", false);
N
netmedia59 author 9/8/2010

Hey Ann,
Thanks for your prompt answer

I know this option

But what I want is really to suppress the option of a print all even if the user write the URL print.php

So the only option will be "dd_badges_print.php?editid1=46" and not "dd_badges_print.php"

For example, even if the user writes the URL "dd_badges_print.php", he will be redirect to the menu page (or something else)
Thanks again
Olivier

Lille (FRANCE)



Olivier,
proceed to the Before display event on the Events tab and hide these links:

$xt->assign("printall_link", false);

$xt->assign("print_link", false);


P
Pkas 9/8/2010

Hi
Try to test in [Before process] of print page:
Something like



if($_GET['editid1']=="") // or if the $_GET even exists

{

echo "<script>alert('Alert... alert... you are trying to access a forbiden page... go away!!')</script>"; // <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=52516&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> lol

echo "<script>history.back(1)</script>"; // or redirect to another page

}
N
netmedia59 author 9/8/2010

Hey pkas,
It's working ... and it's funny

Thanks

Very Good Tip
Olivier

Lille (FRANCE)



Hi
Try to test in [Before process] of print page:
Something like



if($_GET['editid1']=="") // or if the $_GET even exists

{

echo "<script>alert('Alert... alert... you are trying to access a forbiden page... go away!!')</script>"; // <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=52523&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> lol

echo "<script>history.back(1)</script>"; // or redirect to another page

}