Jump to content

[SOLVED] Not linking correctly.


Xtremer360

Recommended Posts

Yeah the script I'm wanting actually came from http://epw.e-wrestling.org/titlehistories.php

I'm just trying to recreate it. I am really trying to do what that site is doing and only have it go to titlehistory.php?id="whateverid"

 

Here's my coding see what you think?

 
<?php

// Connects to your Database
$link = mysql_connect("p50mysql43.secureserver.net", "kow_data", "Kowchamp22") or die(mysql_error());
mysql_select_db("kow_data",$link) or die(mysql_error());

if (!mysql_select_db("kow_data", $link)) {
echo 'Could not select database';
exit;
}


print '<table border=0 cellspacing="0" cellpadding=3 width=575>';
print '<tr><td background="images/bg_bar4.gif" height=35> <font color="white">Title Histories</font></td></tr>';
print '</table>';
print '<table border=0 cellspacing="0" cellpadding=3 width=575>';
print '<tr><td background="images/bg_bar3.gif" height=35 colspan=4> Active Titles</td></tr>';
print '<tr>';

//Define the query
$query = "SELECT * FROM titles WHERE status = 'Active'"; // Active rows

if ($r = mysql_query ($query)){ // Run the query. 

    while ($row = mysql_fetch_array ($r)){
    
        print '<td><a href="titlehistory.php?id=' . $row['id'] . '" title="View KOW '.$row['titlename'].' History">';
        print '<img src="/images/' . $row['titleimage'] . '" border=0 alt="View KOW '.$row['titlename'].' History" height="115px" width="115px"></a></td>';
    
    }

} else {
    die ('<p>Could not retrieve the data because <b>' . mysql_error() . '</b>. The query was $query.</p>');
} //End of query IF 

print '</tr>';
print '</table>';
print '<img src=images/spacer.gif><br>';
print '<table border=0 cellspacing=0 cellpadding=3 width=575><tr><td background="images/bg_bar3.gif" height=35 colspan=2> Inactive Titles</td></tr>';
print '<tr>';

//Define the query
$query = "SELECT * FROM titles WHERE status = 'Inactive'"; // Inactive Rows

if ($r = mysql_query ($query)){ // Run the query. 

    while ($row = mysql_fetch_array ($r)){
    
        print '<td><a href="titlehistory.php?id=' . $row['id'] . '" title="View KOW '.$row['titlename'].' History">';
        print '<img src="/images/' . $row['titleimage'] . '" border=0 alt="View KOW '.$row['titlename'].' History" height="115px" width="115px"></a></td>';
    
    }

} else {
    die ('<p>Could not retrieve the data because <b>' . mysql_error() . '</b>. The query was $query.</p>');
} //End of query IF 

print '</tr>';
print '</table>'; 
?>

 

The page with the titles info is actually here:

 

<?php echo "<body bgcolor=\"black\" link=\"red\" vlink=\"red\">"; ?>

<?php
// Connects to your Database
$link = mysql_connect("?", "?", "?") or die(mysql_error());
mysql_select_db("?",$link) or die(mysql_error());

if (!mysql_select_db("?", $link)) {
echo 'Could not select database';
exit;
}

//Define the query
$query = "SELECT *, DATE_FORMAT(`datecreated`, '%M %e, %Y') as datecreated FROM titlehistory";

if ($r = mysql_query ($query)){ // Run the query.
while ($row = mysql_fetch_array ($r)){

print '<table border=0 cellspacing="0" cellpadding=3 width=575>';
print '<tr><td background="images/bg_bar4.gif" height=35> <font color="white">Title Histories</font></td></tr>';
print '<tr><td></td></tr>';
print '</table>';
print '<table border=0 cellspacing="0" cellpadding=3 width=575>';
print '<tr><td background="images/bg_bar3.gif" height=35 colspan=2><font color=red> KOW '.$row['titlename'].'</font></td></tr>';
print '<tr><td width=200><img src="/images/' . $row['titleimage'] . '" width=208px height=156px border=0 alt="View KOW '.$row['titlename'].' History"></td><td valign=top>';
print '<table cellpadding="2" cellspacing="0" border="0" width=100%>';
print '<tr><td align=center bgcolor=#E0E0E0><b>Date Created</b></td></tr><tr><td align=center><font color=white>'.$row['datecreated'].'</font></td></tr>';
print '<tr><td bgcolor=#E0E0E0 align=center><b>Status</b></td></tr>';
print '<tr><td align=center><font color=white>'.$row['status'].'</font></td></tr>';
print '<tr><td bgcolor=#E0E0E0 align=center><b>Longest Reign</b></td></tr>';
print '<tr><td align=center><a href=bio.php?'.$row['longestreign'].'><b>'.$row['longestreign'].'</b></a> <font color=white>('.$row['numdays'].')</font></td></tr>';
print '<tr><td bgcolor=#E0E0E0 align=center><b>Most Successful Defenses</b></td></tr>';
print '<tr><td align=center><a href=bio.php?'.$row['sucessdefenses'].'><b>'.$row['sucessdefenses'].'</b></a> <font color=white>('.$row['numdef'].')</font></td></tr>';
print '</table></td></tr></table>';
print '<img src=images/spacer.gif><br />';
print '<table cellpadding="2" cellspacing="0" border="0" width=100%>';
print '<tr>';
print '<td valign=top align=center width=115><a href="bio.php?'.$row['wrestlername'].'" title=View History for '.$row['wrestlername'].'>';
print '<img src="/images/' . $row['wrestlername'] . '" border=0 alt=View History for '.$row['wrestlername'].' height=115 width=115></a></td>'; print '<td valign="top" width=100%>';
print '<table border=0 width=100% cellspacing=1 cellpadding=2>';
print '<tr>';
print '<td background="images/bg_bar4.gif" bgcolor=#E0E0E0 align=center width="25"><b>8</b></td>';
print '<td background="images/bg_bar3.gif" bgcolor=#E0E0E0><b> Jesse Jamester</b></td>';
print '</tr>';
print '</table>';
print '<table border=0 width=100% cellspacing=1 cellpadding=2>';
print '<tr>';
print '<td bgcolor=#E0E0E0 align=center width="50%"><font class=small><b>Successful Defenses</b></font></td>';
print '<td bgcolor=#E0E0E0 align=center><font class=small><b>Event</b></font></td>';
print '</tr>';
print '<tr>';
print '<td align="center"><font class=small>1</font></td>';
print '<td align="center"><font class=small><a href=/aggression/results.php?id=1214611200&view=chapter&page=18><b>Friday Aggression</b></a></font></td>';
print '</tr>';
print '<tr>';
print '<td bgcolor=#E0E0E0 align=center><font class=small><b>Reign</b></font></td>';
print '<td bgcolor=#E0E0E0 align=center><font class=small><b>Date Won</b></font></td>';
print '</tr>';
print '<tr>';
print '<td align="center"><font class=small>0 Days</font></td>';
print '<td align="center"><font class=small>June 27, 2008</font></td>';
print '</tr>';
print '<tr>';
print '<td colspan="2"><font class=small><i>Title won in a singles match against John "The Prophet" Adams. </i></font></td>';
print '</tr>';
print '</table>';
print '</td>';
print '</tr>';
print '</table>';
}

} else {
die ('<p>Could not retrieve the data because <b>' . mysql_error() . '</b>. The query was $query.</p>');
} //End of query IF
?>

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.