Forum Moderators: coopster
i do have this piece of code from a 'link of categories' script which redirects to the URL of sites.
I'd like to open the links to a new window, i'm trying with target=\"_blank\" but there's no way, please can you help me?
here's the code:
<?
require("conf/db.php");
$link = mysql_connect($host,$user,$password);
$requete=mysql_db_query($base,"select url from ".$basesites." where id=".$s." ",$link);
$url = mysql_result($requete,0,"url");
header("Location: ".$url."");
exit();
?>
Thanks in advance,
tito
another thought is you could enclose the string in single quotes instead of double, meaning you wouldn't have to escape double quotes in the string, there are no vars needing to be parsed in there. Also in an echo statement you can put commas between the parts needing to be output so that php doesn't have to concatenate everything first before outputting the string
like so
echo '<p><a href="redirect.php?s=',$id,'" target="_blank">',$sitenom,'</a> - ',$description,'</p>';
i've tried with your suggestion and still keeps opening the link in the same window.
that echo output is the only one to call the openlink page, i'm sure, and so by placing the target="_blank" in there should work, but it doesn't, why?