XtremeGamer99
08-11-2004, 11:24 PM
Some of you (esspecially raf) may know mw from my other topic:
http://codingforums.com/showthread.php?t=42881
I have been working on it, got my layout done, and it works great. I wanted to install a "Report Bad Cheat" form, so I added it. the Link goes under the author (this will change), and whenm clicked upon, should go to the cheats ID (...&game=whatever&badcode=number...). It does show the game name, but nothing else, like cheat title or the original cheat. Id oes show something, but it always shows the first cheat on the game page that shows the cheat for that particular game. I want it to, when "Report" is clicked upon, show what the title of the cheat in question is, and what the original cheat was. Here is the code:
<?php
include '../header.php';
// Connect to the database server
$connect= @mysql_connect('localhost', 'root', 'DELETED') or die ('Unable to connect to the MySQL database at this time.' );
// Select the database
@mysql_select_db('gamecube', $connect) or die('Unable to locate the cheats database at this time.' );
$database = 'GameCube';
$badcode = $_GET['badcode'];
$genre = $_GET['genre'];
$letter = $_GET['letter'];
$game = $_GET['game'];
if (isset($badcode))
{
$sql = 'SELECT games.gamename, authors.authorname, cheats.cheattitle, cheats.cheattext FROM cheats INNER JOIN games ON cheats.game=games.gameID INNER JOIN authors ON cheats.author=authors.authorID WHERE cheats.game = "'.$game.'"';
$result=mysql_query($sql) or die ('queryproblem');
while ($row = mysql_fetch_assoc($result)){
if ($name !=$row['gamename'] ){
echo '
<table width="100%">
<tr>
<td class="B"><font size="6">' . $row['gamename'] . '
</font></td>
</tr>
<tr>
<td class="A" align="center">Bad Code Notifiacation</td>
</tr>
<tr>
<td>Title: ' . $row['gamename'] . '<br />
Cheat Title: ' . $row['cheattitle'] . '<br />
Cheat: ' . $row['cheattext'] . '<br />
</td>
</tr>
<!-- Enter your news/content here -->';
$name = $row['gamename'] ;
}
echo ('');
}
echo ('
<!-- End of content -->
</table>
');
}
else if (isset($game))
{
$sql = 'SELECT games.gamename, games.producer, games.release, games.genre, cheats.cheatID, authors.authorname, cheats.cheattitle, cheats.cheattext, cheats.cheatdate FROM cheats INNER JOIN games ON cheats.game=games.gameID INNER JOIN authors ON cheats.author=authors.authorID WHERE cheats.game = "'.$game.'"';
$result=mysql_query($sql) or die ('queryproblem');
while ($row = mysql_fetch_assoc($result)){
if ($name !=$row['gamename'] ){
echo '
<table width="100%">
<tr>
<td class="B"><font size="6">' . $row['gamename'] . '
</font></td>
</tr>
<tr>
<td class="A" align="center">Game Information</td>
</tr>
<tr>
<td align="center">Title: ' . $row['gamename'] . ' || Release: ' . $row['release'] . ' || Genre: ' . $row['genre'] . ' || Producer: ' . $row['producer'] . '
</td>
</tr>
<!-- Enter your news/content here -->';
$name = $row['gamename'] ;
}
echo ('
<tr>
<td class="A">' . $row['cheattitle'] . '</td>
</tr>
<tr>
<td>' . $row['cheattext'] . '
<br />
<br />
<i>- ' . $row['authorname'] . '</i><br /><a href="' . $_SERVER['PHP_SELF'] .'?letter='. $letter .'&game='. $game .'&badcode='. $row['cheatID'] .'">Report</a>
<br /></td>
</tr>
');
}
echo ('
<!-- End of content -->
</table>
');
}
else if (isset($letter))
{
$sql="SELECT gameID, gamename FROM games WHERE gamename LIKE '".$letter."%' ORDER BY gamename asc";
$result=mysql_query($sql) or die ('Queryproblem');
echo ('
<table width="100%">
<tr>
<td class="B"><font size="7">' . $database . '</font></td>
</tr>
<tr>
<td class="A">Games by Genre: ' . $letter . '
</tr>
<tr>
<td>
');
while ($row=mysql_fetch_assoc($result)){
echo ('
<b><a href="' . $_SERVER['PHP_SELF'] .'?letter='. $letter .'&game='. $row['gameID'] .'">'. $row['gamename'] .'</a></b><br />
');
}
echo ('
</td>
</tr>
</table>
');
}
else if (isset($genre))
{
$sql="SELECT gameID, genre, gamename FROM games WHERE genre LIKE '".$genre."' ORDER BY gamename asc";
$result=mysql_query($sql) or die ('Queryproblem');
echo ('
<table width="100%">
<tr>
<td class="B"><font size="7">' . $database . '</font></td>
</tr>
<tr>
<td class="A">Games by Genre: ' . $genre . '
<tr>
<td>
');
while ($row=mysql_fetch_assoc($result)){
echo ('
<b><a href="' . $_SERVER['PHP_SELF'] .'?genre='. $genre .'&game='. $row['gameID'] .'">'. $row['gamename'] .'</a></b><br />
');
}
echo ('
</td>
</tr>
</table>
');
}
else {
echo ('
<table width="100%">
<tr>
<td class="B"><font size="7">' . $database . '</font></td>
</tr>
</table>
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="62%" valign="top">
<table border="0" cellspacing="0" width="100%">
<td class="A">All Games by Alpha</td>
</tr>
<!-- Enter your news/content here -->
<tr>
<td>
<br />
<a href="' . $_SERVER['PHP_SELF'] .'?letter=a">A</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=b">B</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=c">C</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=d">D</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=e">E</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=f">F</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=g">G</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=h">H</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=i">I</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=j">J</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=k">K</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=l">L</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=m">M</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=n">N</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=o">O</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=p">P</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=q">Q</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=r">R</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=s">S</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=t">T</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=u">U</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=v">V</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=w">W</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=x">X</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=y">Y</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=z">Z</a>
<br /><br /></td>
</tr>
<table border="0" cellspacing="0" width="100%">
<td class="A">All Games by Genre</td>
</tr>
<tr>
<td>
<br />
<a href="' . $_SERVER['PHP_SELF'] .'?genre=action">Action</a>|<a href="' . $_SERVER['PHP_SELF'] .'?genre=adventure">Adventure</a>|<a href="' . $_SERVER['PHP_SELF'] .'?genre=driving">Driving</a>|<a href="' . $_SERVER['PHP_SELF'] .'?genre=puzzle">Puzzle</a>|<a href="' . $_SERVER['PHP_SELF'] .'?genre=roleplaying">RolePlaying</a>|<a href="' . $_SERVER['PHP_SELF'] .'?genre=simulation">Simulation</a>|<br><a href="' . $_SERVER['PHP_SELF'] .'?genre=sports">Sports</a>|<a href="' . $_SERVER['PHP_SELF'] .'?genre=strategy">Strategy</a>
<br /><br /></td>
</tr>
</table>
<td width="38%" valign="top">
<table border="1" cellspacing="0" width="100%">
<tr>
<!-- Start Right Column -->
<!-- Start Poll -->
<form method="post" action="http://poll.pollhost.com/vote.cgi">
<table border= width="150" bgcolor="#000000" cellspacing= cellpadding="2">
<tr>
<td align="center" class="A">GameCube Poll</td>
</tr>
<tr>
<td class="content">
<b><center>How many GameCube games do you own?</center></b><br />
<input type=radio name=answer value=1 /> None<br />
<input type=radio name=answer value=2 /> 1-10<br />
<input type=radio name=answer value=3 /> 11-20<br />
<input type=radio name=answer value=4 /> 21-30<br />
<input type=radio name=answer value=5 /> 31-40<br />
<input type=radio name=answer value=6 /> 41-50<br />
<input type=radio name=answer value=7 /> More
</tr>
<tr>
<td class="content">
<input type="hidden" name="config" value="WHRyZW1lR2FtZXI5OQkxMDgwNjA1MjEwCTAwMDAwMAlGRkZGRkYJVmVyZGFuYQlBc3NvcnRlZA" />
<center><input type="submit" value="Vote" /> <input type="submit" name="view" value="View" /></center>
</td>
</tr>
</table>
</form>
<!-- End Poll -->
</table>
<!-- End of content -->
');
}
include '../footer.php';
?>
I don't think that you will need the MySQL tables for this one, but if you do, just tell me.
http://codingforums.com/showthread.php?t=42881
I have been working on it, got my layout done, and it works great. I wanted to install a "Report Bad Cheat" form, so I added it. the Link goes under the author (this will change), and whenm clicked upon, should go to the cheats ID (...&game=whatever&badcode=number...). It does show the game name, but nothing else, like cheat title or the original cheat. Id oes show something, but it always shows the first cheat on the game page that shows the cheat for that particular game. I want it to, when "Report" is clicked upon, show what the title of the cheat in question is, and what the original cheat was. Here is the code:
<?php
include '../header.php';
// Connect to the database server
$connect= @mysql_connect('localhost', 'root', 'DELETED') or die ('Unable to connect to the MySQL database at this time.' );
// Select the database
@mysql_select_db('gamecube', $connect) or die('Unable to locate the cheats database at this time.' );
$database = 'GameCube';
$badcode = $_GET['badcode'];
$genre = $_GET['genre'];
$letter = $_GET['letter'];
$game = $_GET['game'];
if (isset($badcode))
{
$sql = 'SELECT games.gamename, authors.authorname, cheats.cheattitle, cheats.cheattext FROM cheats INNER JOIN games ON cheats.game=games.gameID INNER JOIN authors ON cheats.author=authors.authorID WHERE cheats.game = "'.$game.'"';
$result=mysql_query($sql) or die ('queryproblem');
while ($row = mysql_fetch_assoc($result)){
if ($name !=$row['gamename'] ){
echo '
<table width="100%">
<tr>
<td class="B"><font size="6">' . $row['gamename'] . '
</font></td>
</tr>
<tr>
<td class="A" align="center">Bad Code Notifiacation</td>
</tr>
<tr>
<td>Title: ' . $row['gamename'] . '<br />
Cheat Title: ' . $row['cheattitle'] . '<br />
Cheat: ' . $row['cheattext'] . '<br />
</td>
</tr>
<!-- Enter your news/content here -->';
$name = $row['gamename'] ;
}
echo ('');
}
echo ('
<!-- End of content -->
</table>
');
}
else if (isset($game))
{
$sql = 'SELECT games.gamename, games.producer, games.release, games.genre, cheats.cheatID, authors.authorname, cheats.cheattitle, cheats.cheattext, cheats.cheatdate FROM cheats INNER JOIN games ON cheats.game=games.gameID INNER JOIN authors ON cheats.author=authors.authorID WHERE cheats.game = "'.$game.'"';
$result=mysql_query($sql) or die ('queryproblem');
while ($row = mysql_fetch_assoc($result)){
if ($name !=$row['gamename'] ){
echo '
<table width="100%">
<tr>
<td class="B"><font size="6">' . $row['gamename'] . '
</font></td>
</tr>
<tr>
<td class="A" align="center">Game Information</td>
</tr>
<tr>
<td align="center">Title: ' . $row['gamename'] . ' || Release: ' . $row['release'] . ' || Genre: ' . $row['genre'] . ' || Producer: ' . $row['producer'] . '
</td>
</tr>
<!-- Enter your news/content here -->';
$name = $row['gamename'] ;
}
echo ('
<tr>
<td class="A">' . $row['cheattitle'] . '</td>
</tr>
<tr>
<td>' . $row['cheattext'] . '
<br />
<br />
<i>- ' . $row['authorname'] . '</i><br /><a href="' . $_SERVER['PHP_SELF'] .'?letter='. $letter .'&game='. $game .'&badcode='. $row['cheatID'] .'">Report</a>
<br /></td>
</tr>
');
}
echo ('
<!-- End of content -->
</table>
');
}
else if (isset($letter))
{
$sql="SELECT gameID, gamename FROM games WHERE gamename LIKE '".$letter."%' ORDER BY gamename asc";
$result=mysql_query($sql) or die ('Queryproblem');
echo ('
<table width="100%">
<tr>
<td class="B"><font size="7">' . $database . '</font></td>
</tr>
<tr>
<td class="A">Games by Genre: ' . $letter . '
</tr>
<tr>
<td>
');
while ($row=mysql_fetch_assoc($result)){
echo ('
<b><a href="' . $_SERVER['PHP_SELF'] .'?letter='. $letter .'&game='. $row['gameID'] .'">'. $row['gamename'] .'</a></b><br />
');
}
echo ('
</td>
</tr>
</table>
');
}
else if (isset($genre))
{
$sql="SELECT gameID, genre, gamename FROM games WHERE genre LIKE '".$genre."' ORDER BY gamename asc";
$result=mysql_query($sql) or die ('Queryproblem');
echo ('
<table width="100%">
<tr>
<td class="B"><font size="7">' . $database . '</font></td>
</tr>
<tr>
<td class="A">Games by Genre: ' . $genre . '
<tr>
<td>
');
while ($row=mysql_fetch_assoc($result)){
echo ('
<b><a href="' . $_SERVER['PHP_SELF'] .'?genre='. $genre .'&game='. $row['gameID'] .'">'. $row['gamename'] .'</a></b><br />
');
}
echo ('
</td>
</tr>
</table>
');
}
else {
echo ('
<table width="100%">
<tr>
<td class="B"><font size="7">' . $database . '</font></td>
</tr>
</table>
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="62%" valign="top">
<table border="0" cellspacing="0" width="100%">
<td class="A">All Games by Alpha</td>
</tr>
<!-- Enter your news/content here -->
<tr>
<td>
<br />
<a href="' . $_SERVER['PHP_SELF'] .'?letter=a">A</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=b">B</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=c">C</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=d">D</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=e">E</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=f">F</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=g">G</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=h">H</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=i">I</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=j">J</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=k">K</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=l">L</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=m">M</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=n">N</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=o">O</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=p">P</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=q">Q</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=r">R</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=s">S</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=t">T</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=u">U</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=v">V</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=w">W</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=x">X</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=y">Y</a>|<a href="' . $_SERVER['PHP_SELF'] .'?letter=z">Z</a>
<br /><br /></td>
</tr>
<table border="0" cellspacing="0" width="100%">
<td class="A">All Games by Genre</td>
</tr>
<tr>
<td>
<br />
<a href="' . $_SERVER['PHP_SELF'] .'?genre=action">Action</a>|<a href="' . $_SERVER['PHP_SELF'] .'?genre=adventure">Adventure</a>|<a href="' . $_SERVER['PHP_SELF'] .'?genre=driving">Driving</a>|<a href="' . $_SERVER['PHP_SELF'] .'?genre=puzzle">Puzzle</a>|<a href="' . $_SERVER['PHP_SELF'] .'?genre=roleplaying">RolePlaying</a>|<a href="' . $_SERVER['PHP_SELF'] .'?genre=simulation">Simulation</a>|<br><a href="' . $_SERVER['PHP_SELF'] .'?genre=sports">Sports</a>|<a href="' . $_SERVER['PHP_SELF'] .'?genre=strategy">Strategy</a>
<br /><br /></td>
</tr>
</table>
<td width="38%" valign="top">
<table border="1" cellspacing="0" width="100%">
<tr>
<!-- Start Right Column -->
<!-- Start Poll -->
<form method="post" action="http://poll.pollhost.com/vote.cgi">
<table border= width="150" bgcolor="#000000" cellspacing= cellpadding="2">
<tr>
<td align="center" class="A">GameCube Poll</td>
</tr>
<tr>
<td class="content">
<b><center>How many GameCube games do you own?</center></b><br />
<input type=radio name=answer value=1 /> None<br />
<input type=radio name=answer value=2 /> 1-10<br />
<input type=radio name=answer value=3 /> 11-20<br />
<input type=radio name=answer value=4 /> 21-30<br />
<input type=radio name=answer value=5 /> 31-40<br />
<input type=radio name=answer value=6 /> 41-50<br />
<input type=radio name=answer value=7 /> More
</tr>
<tr>
<td class="content">
<input type="hidden" name="config" value="WHRyZW1lR2FtZXI5OQkxMDgwNjA1MjEwCTAwMDAwMAlGRkZGRkYJVmVyZGFuYQlBc3NvcnRlZA" />
<center><input type="submit" value="Vote" /> <input type="submit" name="view" value="View" /></center>
</td>
</tr>
</table>
</form>
<!-- End Poll -->
</table>
<!-- End of content -->
');
}
include '../footer.php';
?>
I don't think that you will need the MySQL tables for this one, but if you do, just tell me.