0

I want to open hyperlink in new tab which is in generated pdf.

  <?php if(($appval['name'])== 'PDF'){?>
         <dt ><?php echo stripslashes($appval['name']); ?></dt>
        <dd><a href=<?php echo stripslashes($appval['value']); ?> target="_blank"><?php echo stripslashes($appval['value']); ?></a></dd>
    <?php } else{?>
            <dt ><?php echo stripslashes($appval['name']); ?></dt>
        <dd><?php echo stripslashes($appval['value']); ?></dd>
        <?php }?>
            <?php } ?>
            </dl>
            <hr />
            <div style="page-break-before: always;"></div>
        <?php  }            
    }  
}

This does work :

<dd><a href=<?php echo stripslashes($appval['value']); ?> target="_blank"><?php echo stripslashes($appval['value']); ?></a></dd>
deve cot
  • 35
  • 1
  • 8
  • You can try this link and follow on: [Open a new tab using javascript](http://stackoverflow.com/questions/4907843/open-a-url-in-a-new-tab-and-not-a-new-window-using-javascript) – Ting Shun Ng Feb 01 '16 at 08:03
  • Thanks for the reply , In my case i got the embedded output file . html elements are not considering . – deve cot Feb 01 '16 at 08:45

1 Answers1

0

In a quick visual walkthrough of your code snippet, separating it out in a text editor to make the conditional branching a little easier to follow, I notice that if control passes into your else branch, no </a> will be issued. Your if-true branch does issue an </a>, and the code you have introduced as "This does work:" issues one as well, but the else branch does not.

acg_so
  • 274
  • 1
  • 4