$html=<<<html
<tr><td>$i.<a href="offtask.php?taskid=$taskid target='_blank' ">$title</a></td><td>$count</td><td class="nowrap">$locationtext</td></tr>
html;
echo $html;
How to open a new window in the code above? target='_blank'
doesn't work.
$html=<<<html
<tr><td>$i.<a href="offtask.php?taskid=$taskid target='_blank' ">$title</a></td><td>$count</td><td class="nowrap">$locationtext</td></tr>
html;
echo $html;
How to open a new window in the code above? target='_blank'
doesn't work.
look at the code output by that code. It will look like this:
<tr><td>$i.<a href="offtask.php?taskid=$taskid target='_blank' ">$title</a></td><td>$count</td><td class="nowrap">$locationtext</td></tr>
and you want it to be
<tr><td>$i.<a href="offtask.php?taskid=$taskid" target="_blank">$title</a></td><td>$count</td><td class="nowrap">$locationtext</td></tr>
That is:
<a href="url" target="_blank">link</a>
Your target
attribute is stuck inside your href
attribute. Try this:
$html=<<<html
<tr><td>$i.<a href="offtask.php?taskid=$taskid" target="_blank">$title</a></td><td>$count</td><td class="nowrap">$locationtext</td></tr>
html;
echo $html;
The reason it's not working is because you haven't separated your link attributes properly. Try outputting the href
and the target
with proper separation (ie, close your quotes).
Use this:
<a href="offtask.php?taskid=$taskid" target='_blank'>
instead of
<a href="offtask.php?taskid=$taskid target='_blank' ">