Jump to content

[SOLVED] i love you guys (another i've been staring at this forever - $_GET fail edition)


Zeradin

Recommended Posts

I have a reviews page, that when you click on games it goes to this:

<?php			  		  
$id = $_GET['id'];
// set database server access variables:
$host = "localhost";
$user = "hypboard_hyp";
$pass = "password";
$db = "hypboard_hypnet";

// open connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");

if ($id == NULL) {

// create show query
$query = 'SELECT * FROM reviews WHERE type = "game"';
// execute show query
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());




echo '<table border="1" cellspacing="3" cellpadding="3" width="100%" height="100%"><tr>
<td valign="top" width="49%" height="100%"><img src="images/showtitle.png" alt="fucking....shows" /><br />';

// see if any rows were returned
if (mysql_num_rows($sresult) > 0) {
     // yes
     // print them one after another
     echo '
<span class="news">
<table width="100%" height="100%">';
     while(list($id, $title, $reviewer)  = mysql_fetch_row($sresult)) {
          echo '<tr>';
          echo '<td><a href="reviews.php?rtyp=game&id='.$id.'">'.$title.'</a>  ::  <span class="poster">';
	  //get user id
	  $idquery = 'SELECT id FROM users WHERE username = "'.$reviewer.'"';
	  $idresult = mysql_query($idquery) or die ("Error in query: $idquery. ".mysql_error());
	  $idrow = mysql_fetch_assoc($idresult);
	  $uid = $idrow['id'];
	  echo '<a href="profile.php?userid='.$uid.'">'.$reviewer.'</span></td>';
          echo '</tr>';
     }
     echo '</table>
</span></td>';
}
else {
echo 'no shows found!';
}

echo '</tr></table>';
}
else {
include('reviews/game.php');
}
?>

 

the game.php:

<?php

$id = $_GET['id'];
$file = "reviews/xml/".$id.".xml";
$xml = simplexml_load_file($file) or die ("Unable to load XML file!");

if ($id == NULL){
echo "you fucked up!";
}
else {

echo '<h2 class="newstitle">'.$xml->title.' - '.$xml->rdate.'</h2><a href="reviews.php?rtyp=music" class="white">[bACK]</a>
<span class="news"></span>
<table cellpadding="4" cellspacing="4" border="1" align="right">
  <tr> 
    <td valign="top" width="200" align="center" class="news"> <img src="reviews/rimages/'.$xml->image.'" alt="review photo no available" /><br />
      <span class="news"><strong class="red">
      Date:</strong><br />
      '.$xml->rdate.'<br /><br />
      <strong class="red">Location:</strong><br />
      <a href="reviews.php?rtyp=music&id='.$xml->developer.'">'.$xml->developer.'</a><br /><br />
<strong class="red"><a href="'.$xml->developer.'">'.$xml->developer.'</a></strong></span><br />
</td>
  </tr>
</table>';
echo nl2br('<span class="news">'.$xml->developer.'<br /></span>');
echo '<br /><br />';
include ('pblock.php');
}
?>

 

i put an echo in before the 'includes('reviews/game.php')' but it didn't show the echo.

 

also i have a music section that does pretty much the exact same thing and i even copied and pasted it in to make this one and it didn't work... also the xml is there and on the gamerev.php it displays the menu properly it's just when i click this link.

 

thanks!

Archived

This topic is now archived and is closed to further replies.

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