Jump to content

Display content onClick link in own page


Remote Control

Recommended Posts

Hi All,

 

I would like to display content in a div depending on which link a user clicks, below is the code that creates the links.

 

<?php
$sql="SELECT * FROM bands ORDER BY title";
//echo $sql;
$res=SQL_query($sql);
echo "<table>";
while ($row=SQL_fetch_array($res)){
         echo "<tr><td>";
         $ren_url=make_redundant_url($row['title']);
         echo "</td><td><a href='release_info.php?id=".$row['id_band']."$ren_url'>".$row['title']."</a></td>";

         echo "</tr>";
}         
echo "</table>";         
?>

 

And here is the code I would like to display when the link is clicked

 

<?phpwhile ($row=SQL_fetch_array($res)){

         if ($flag==0){
               echo "<h1></h1> 
                           </div>
                           <div class=\"content_holder\"><div class=\"catalogue_item\">";
               
            if ($row['mp3']<>""){
               echo "<p><b>Download MP3:</b> <a href=\"uploads/mp3s/".$row['mp3']."\">".$row['mp3']."</a></p><br>";
            }
            echo "<b>Releases:</b><br>";
            $flag=1;
         }
         //TODO: new catalogue page.
         $ren_url=make_redundant_url($row['bandname'],$row['title']);
         echo "<img src='tinyimage.php?file=uploads/releases/".$row['imageurl']."' border='0'><a href='release_detail.php?id=".$row['id_release']."$ren_url'>".$row['bandname']." "".$row['title']."" ".$row['type']." $".$row['price']." (".$row['catnum'].")</a>";
             if ($row['new']==1){
               echo " <b><font color='#FF0000'>NEW!!</font></a></b> ";
             }         
             if ($row['sold_out']==0){
                     echo "  (<a href='basket.php?add="."cd_".substr($row['catnum'],-3)."'><i>Add To Basket</i></a>)";
             }
         echo "<br>";
}?>

 

What would  be the best way to display this without having to load a new page?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.