CuriousGuy
CuriousGuy

Reputation: 31

How to make this dynamic link open new tab?

 <a style="text-decoration:underline;" href="https://mydomain.com/register/<?php echo $locat?>">CONTINUE BROWSING &raquo;</a>

Hey guys i have 3 different registration user types that all go to my "payment page" where i display 3 different packages..

i have one of those contiinue browsing links but if a user clicks that they cant go back because the unique token expires....

i want this link to open a new tab or page when they click it this way i dont have to worry if a user was just click the link to see what it was but then cant go back to actually sign up.... ive read online but it keeps causing errors on page when i try to do it./

Any tips, i appreciate sorry for the easy question but i do appreciate it.

Upvotes: 0

Views: 4114

Answers (2)

ro0ter
ro0ter

Reputation: 439

<a target="_blank" href="https://yourwebsite.com/">link name</a>

or you could use <a rel="ext" href="external website>link name</a> and have a script add target="_blank" to all anchors with rel="ext" once the document is loaded.

Example:

<script type="text/javascript" src="jquery-1.8.2.min.js"></script>
<script type="text/javascript">
  $(document).ready(function() {
    $(document).find('a[rel="ext"]').attr("target", "_blank");
  });
</script>
...
<body>
   <a rel="ext" href="some website">some name</a>

Upvotes: 3

Fahadi Muhumuza
Fahadi Muhumuza

Reputation: 161

Use <a target="blank" href="yourlink">link name</a> Because blank instead of _blank will force the browser to open the same tab if the link is clicked again which is pretty nice for me. So try it out

Upvotes: 0

Related Questions