PDA

View Full Version : linking: A noob question. -_-;


Red Blaze
01-28-2004, 08:21 PM
I'm gonna keep updating this thread with questions so I won't have to make a new one, so here's my first noob question.

I'm trying to learn PHP, so without leaving the php file, how can you link? Example, you're here

forum/memberlist.php?

I then click on a letter, and you don't leave memberlist.php, but you get a new page.

What I want in my situation is, I have a review page, and I have a list of games. I click on a game and I don't want to leave the review page, but I get a new page of a review of the game I clicked. Is any of this making sense?

mr e
01-29-2004, 03:32 AM
You'd use regular HTML with target="_blank"

ex: <a href="./forum/memberlist.php?" target="_blank">Link</a>

g-force2k2
01-29-2004, 08:08 AM
Sonikku,

You have to eval different templates.

for example you have the games sonic_heroes and sonic adventures

You would create php code like this:

$defaultgame = "sonicbattle2" ;
if ( empty ( $game ) ) :
$game = $defaultgame ;
endif ;

eval ( "\$gametemplate = \"" . gettemplate ( $game ) . "\" ;" ) ;

eval ( "dooutput ( \"" . gettemplate ( "game_review" ) . "\" ) ;" ) ;
exit ;

Then to link the games you would have links like:

<a href="gamereview.php?game=sonic_heroes">Sonic Heroes</a>
<a href="gamereview.php?game=sonic_adventure">Sonic Adventure</a>

This is on the assumption that each review has its own template and that the game_review template is the base template in the php file gamereview.php

Hope that helps somewhat.

Cheers,
g-force2k2

Red Blaze
02-04-2004, 08:20 PM
Thanks g-force2k2, but I was able to find an easier code. ^_^ Now I want something different. I have 2 banner ads and I want to rotate them every time the page loads. I tried Mists rotating banner, but that one couldn't link to the sites (they're affiliates). Help?