Just need a little help

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

Post Reply
chrisk1152
Forum Newbie
Posts: 9
Joined: Wed Apr 02, 2008 4:02 pm

Just need a little help

Post by chrisk1152 »

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
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: Just need a little help

Post by flying_circus »

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>";
?>
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Just need a little help

Post by RobertGonzalez »

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

Re: Just need a little help

Post by chrisk1152 »

I am using an Iframe and the games do not fit in it when you click on it.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Just need a little help

Post by RobertGonzalez »

Ok then, use the previously mentioned suggestion of target="_blank". Understand that targeting like that is not XHTML Strict compliant though.
Post Reply