Jump to content

Recommended Posts

I got two lists on a website. One list includes bunch of items and simple info. Another list includes pictures of those items and detailed information. I would like to set it up that way when users clicks on item from list #1 it would automatically jump to an item with the picture and detailed info on a second list.

Link to comment
https://forums.phpfreaks.com/topic/225564-php-linking-question/
Share on other sites

Here you go list #1

<div class="div_title">Complete Weapons Listing - click on weapon name for details:</div>
<div class="spacer"></div>
<div class="tab_pad">
<table cellpadding="0" cellspacing="0" class="sets" width="550">
<tr>
<td class="title" rowspan="2">Weapon Title</td>
<td class="title" colspan="6">Can be equiped by:</td>
</tr>
<tr>
<td class="title">Knight</td>
<td class="title">Wizard</td>
<td class="title">Elf</td>
<td class="title">Gladiator</td>
<td class="title">Lord</td>
<td class="title">Summoner</td>
<td class="title">Rage</td>
</tr>
<?
$set_query = mssql_query("SELECT id, Title, knight, wizard, elf, gladiator, lord, summoner, rage, type FROM weapons_data ORDER by Title asc");
for($i = 0; $i < mssql_num_rows($set_query);++$i)
{
    $set_row = mssql_fetch_row($set_query);
if ($set_row[2] == 1)
	$set_row[2] = "Yes";
else
	$set_row[2] = "-";
if ($set_row[3] == 1)
	$set_row[3] = "Yes";
else
	$set_row[3] = "-";
if ($set_row[4] == 1)
	$set_row[4] = "Yes";
else
	$set_row[4] = "-";
if ($set_row[5] == 1)
	$set_row[5] = "Yes";
else
	$set_row[5] = "-";
if ($set_row[6] == 1)
	$set_row[6] = "Yes";
else
	$set_row[6] = "-";
if ($set_row[7] == 1)
	$set_row[7] = "Yes";
else
	$set_row[7] = "-";
if ($set_row[8] == 1)
	$set_row[8] = "Yes";
else
	$set_row[8] = "-";


    ?><tr>
    <td width=300 align=left><a href="?page_id=view_single_weapon&weapon=<? echo $set_row[0]; ?>" alt="<? echo $set_row[1]; ?>"><? echo $set_row[1]; ?></a></td>


    <td align=center><? echo $set_row[2]; ?></td>
    <td align=center><? echo $set_row[3]; ?></td>
    <td align=center><? echo $set_row[4]; ?></td>
    <td align=center><? echo $set_row[5]; ?></td>
    <td align=center><? echo $set_row[6]; ?></td>
    <td align=center><? echo $set_row[7]; ?></td>
    <td align=center><? echo $set_row[8]; ?></td>
    </tr><?
}
?>
</table></div>

 

And list #2

<?
if (isweapon($_GET['weapon']))
{			
$query = mssql_query("SELECT id, Title, mindmg, maxdmg, minexcdmg, maxexcdmg, type FROM weapons_data WHERE id = ".$_GET['weapon']." ORDER by mindmg asc");
$set_row = mssql_fetch_row($query);
$imagename = str_replace(" ", "_", $set_row[1]);
$imagename = strtolower($imagename);
?>
<div class="div_title" align=center><? echo $set_row[1]; ?>:</div>
<div class="spacer"></div>
<table cellpadding="0" cellspacing="0" class="sets_table" width="400" align=center>
<tr><td rowspan="17" width="124" ><img src="/guides/sets/images/<? echo $imagename; ?>.jpg" alt="<? echo $set_row[1]; ?> Set" width="124" height="200" /></td>
<td>Level</td>
<td>Minimum Damage</td>
<td>Maximum Damage</td>
<td>Minimum Exc Damage</td>
<td>Maximum Exc Damage</td>
</tr>
<tr>
<td>+0</td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>       
<tr>
<td>+1</td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+2 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+3 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+4 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+5 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+6 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+7 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+8 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+9 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+10 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+11 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+12 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+13 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+14 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
<tr>
<td>+15 </td>
<td><? echo $set_row[2]; ?></td>
<td><? echo $set_row[3]; ?></td>
<td><? echo $set_row[4]; ?></td>
<td><? echo $set_row[5]; ?></td>
</tr>
</table><BR><BR>
<a href="/index.php?page_id=reg_set_list">Go back to list</a>
<?
}
?>

 

When person clicks on item from list #1 I need it to fetch that item form list #2 is that possible. If you see any other issues wit code I would really appreciate if u let me know.

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.