open link in new tab

Hey guys,
I got this bit of code
[php]
echo “

<a href=”$var">$var";
[/php]
Basically it displays a link in a table.
$var is a post variable which contains a link.
Is there anyway way i can get it to open in a new window/tab?

i have tried:
[php]
echo “

<a href=”$var"target="_blank">$var";
[/php]
but it doesn’t seen to be working.Any help is appreciated :slight_smile:
Thanks.

please use below code:
[php]

$var = ‘http://www.google.co.in/’;
echo ‘

’.$var.’’;

Tips : whenever you use to echo html tag than use single quotes out side and use double quotes for define there property or attribute as i did above.

[/php]

reply Your feedback…
SR

Thanks a lot.Yes that solved the problem.

Sponsor our Newsletter | Privacy Policy | Terms of Service