sheff Posted February 21, 2009 Share Posted February 21, 2009 Hello I'm running Vidiscript at www.thewebsmystage.com I have an outbound link module that I can't seem to get the links to open in a new window. I assume it is here: <?php function show_for_bar() { global $db; echo '<div>'; $lime = getSetting("traffic",$db); $sql = "SELECT * FROM `traffic` ORDER BY `In` DESC LIMIT 0, $lime"; $result = $db->query($sql); while($row = $db->fetch()) { echo '<div align="left"><a href="'.$sitepath.'out?url='.$row['Url'].'">'.$row['Sitename'].'</a></div><br>'; } echo "</div>"; } ?> which I assume works with this out.php file <?php function goout($redirect) { if (!$redirect) { echo "You have not designated a url to leave website to"; exit; } include 'includes/settings.inc'; mysql_connect($db_host, $db_user, $db_password) or die("Install Script First"); mysql_select_db($db_database) or die("Db Not Found"); $sql = "UPDATE traffic SET `Out` = `Out` + 1 WHERE Url='$redirect'"; mysql_query($sql) or die("Error Adding Stats"); } ?> Any suggestions to get the links to open in a new window would be very helpful. Thanks Sheff Quote Link to comment https://forums.phpfreaks.com/topic/146239-solved-outbound-link/ Share on other sites More sharing options...
Cal Posted February 21, 2009 Share Posted February 21, 2009 <a href="'.$sitepath.'out?url='.$row['Url'].'" target="_blank">'.$row['Sitename'].'</a> try that add target="_blank" to the links you want to open in a new window Quote Link to comment https://forums.phpfreaks.com/topic/146239-solved-outbound-link/#findComment-767753 Share on other sites More sharing options...
sheff Posted February 21, 2009 Author Share Posted February 21, 2009 Great job! Thanks works perfectly Quote Link to comment https://forums.phpfreaks.com/topic/146239-solved-outbound-link/#findComment-767754 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.