Jump to content

Help with target=_blank


SamiBH

Recommended Posts

Hello

 

I need HELP

 

                   print("<tr><td class=\"lista\"><b><a title=\"".$language["FIRST_UNREAD"].": ".preg_replace("/Re:/", "", $trow["title"])."\" href=\"smf/index.php/topic," . $trow['tid'] . ".msg" . $trow['goto_last_post'] . ".html#new\"\"target=\"_blank\">" . substr($title,0,30) . "...</a></b><br />".$language["LAST_POST_BY"]." <a href='smf/index.php?action=profile;u=" . $trow['last_poster_id'] . "'\"target=\"_blank\">" .$trow['last_poster_name'] ."</a><br />On " . date('d/m/Y H:i:s',$trow["last_post"]). "</td></tr>\n");

 

this code work fine in firefox and google chrome. (link open in new page)

 

but in IE don't work. (opens in the same page)

 

how can i make it work in IE

 

thank you for your time and help

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/205944-help-with-target_blank/
Share on other sites

You should look at the HTML output and see what's wrong. It looks like you have an extra \", try this:

 

print("<tr><td class=\"lista\"><b><a title=\"".$language["FIRST_UNREAD"].": ".preg_replace("/Re:/", "", $trow["title"])."\" href=\"smf/index.php/topic," . $trow['tid'] . ".msg" . $trow['goto_last_post'] . ".html#new\" target=\"_blank\">" . substr($title,0,30) . "...</a></b><br />".$language["LAST_POST_BY"]." <a href='smf/index.php?action=profile;u=" . $trow['last_poster_id'] . "'\"target=\"_blank\">" .$trow['last_poster_name'] ."</a><br />On " . date('d/m/Y H:i:s',$trow["last_post"]). "</td></tr>\n");

You have two links there, the other one seems to have the same problem.

 

print("<tr><td class=\"lista\"><b><a title=\"".$language["FIRST_UNREAD"].": ".preg_replace("/Re:/", "", $trow["title"])."\" href=\"smf/index.php/topic," . $trow['tid'] . ".msg" . $trow['goto_last_post'] . ".html#new\" target=\"_blank\">" . substr($title,0,30) . "...</a></b><br />".$language["LAST_POST_BY"]." <a href='smf/index.php?action=profile;u=" . $trow['last_poster_id'] . "' target=\"_blank\">" .$trow['last_poster_name'] ."</a><br />On " . date('d/m/Y H:i:s',$trow["last_post"]). "</td></tr>\n");

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.