PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
chrisk1152
Forum Newbie
Posts: 9 Joined: Wed Apr 02, 2008 4:02 pm
Post
by chrisk1152 » Fri May 09, 2008 10:35 pm
I want to add some code so that it opens in a new window.
Code: Select all
echo '<a href='.$game[$number]['link'].'>';
echo '<img src='.$image[$number]['img'].' border="2.5" /><br />';
echo "<center>".$title[$number]['img']."</center>";
echo "</a>";
Is the end code. If you need all of it please let me know.
Thanks
flying_circus
Forum Regular
Posts: 732 Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR
Post
by flying_circus » Fri May 09, 2008 11:09 pm
Cant you just use the "target" attribute for an a tag?
Code: Select all
<?php
echo '<a href='.$game[$number]['link'].' target="_blank">';
echo '<img src='.$image[$number]['img'].' border="2.5" /><br />';
echo "<center>".$title[$number]['img']."</center>";
echo "</a>";
?>
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Sat May 10, 2008 1:21 am
Do you have to open a new window? That can get a little irritating for users.
chrisk1152
Forum Newbie
Posts: 9 Joined: Wed Apr 02, 2008 4:02 pm
Post
by chrisk1152 » Sat May 10, 2008 9:58 am
I am using an Iframe and the games do not fit in it when you click on it.
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Sat May 10, 2008 12:00 pm
Ok then, use the previously mentioned suggestion of target="_blank". Understand that targeting like that is not XHTML Strict compliant though.