Jump to content

Undefined Index


Xtremer360

Recommended Posts

It says Notice: Undefined index: page in /home/content/y/a/n/yankeefaninkc/html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 111

 

Which is the following line:

 

switch ($_GET['page']) 

 

Rest of code:

 

<?php
if(isset($_GET['username']) && $_GET['username'] != ''){
$username = $_GET['username'];
$query = "SELECT bio.username AS username, ebw.manager_id AS managerid, ebw.finisher AS finisher, ebw.setup AS setup, ebw.music AS music, ebw.nicknames AS nicknames, bio.id AS id, bio.posername AS posername, bio.charactername AS charname, bio.style_id AS style, bio.status_id AS status FROM `efed_bio` AS bio LEFT JOIN `efed_bio_wrestling` AS ebw ON bio.id = ebw.bio_id WHERE bio.username = '$username'";
if(!$result = mysql_query($query)){ debug($query); }
while ($row = mysql_fetch_assoc($result)){
	$fieldarray=array('id','username','posername','charname','style','managerid','finisher','setup','music','nicknames');
	foreach ($fieldarray as $fieldlabel){
		if (isset($row[$fieldlabel])){ 
			$$fieldlabel=$row[$fieldlabel];
			$$fieldlabel=cleanquerydata($$fieldlabel);
		}
	}
}

$query2 = "SELECT * FROM `efed_bio_quotes` WHERE bio_id = '$id'";
if(!$result2 = mysql_query($query2)){ debug($query2); }
$i = 0;
$quotes = array();
while($row2 = mysql_fetch_assoc($result2)){
	$fieldarray=array('quote');

	$quotes[$i] = $row2['quote'];
	$i++;
}

if($managerid != ''){
	$query = "SELECT * FROM `efed_bio` WHERE id = '$managerid'";
	$result = mysql_query($query);
	$row = mysql_fetch_assoc($result);
	$manager = $row['charactername'];
}
else{
	$manager = 'None';
}

switch($style){
	case 2:
		//tag team query
	break;

	case 3:
		$query3 = "SELECT * FROM `efed_bio_manager` WHERE bio_id = '$id'";
		if(!$result3 = mysql_query($query3)){ debug($query3); }
			while ($row3 = mysql_fetch_assoc($result3)){
				$height = $row3['height'];
				$weight = $row3['weight'];
				$hometown = $row3['hometown'];
			}
	break;

	case 4:
		$query3 = "SELECT * FROM `efed_bio_referee` WHERE bio_id = '$id'";
		if(!$result3 = mysql_query($query3)){ debug($query3); }
			while ($row3 = mysql_fetch_assoc($result3)){
				$height = $row3['height'];
				$weight = $row3['weight'];
				$hometown = $row3['hometown'];
			}
	break;

	case 5:
		$query3 = "SELECT * FROM `efed_bio_staff` WHERE bio_id = '$id'";
		if(!$result3 = mysql_query($query3)){ debug($query3); }
			while ($row3 = mysql_fetch_assoc($result3)){
				$height = $row3['height'];
				$weight = $row3['weight'];
				$hometown = $row3['hometown'];
				$job = $row3['job'];
			}
	break;

	case 6:
		//stable query
	break;

	default:
		$query3 = "SELECT * FROM `efed_bio_singles` WHERE bio_id = '$id'";
		if(!$result3 = mysql_query($query3)){ debug($query3); }
			while ($row3 = mysql_fetch_assoc($result3)){
				$height = $row3['height'];
				$weight = $row3['weight'];
				$hometown = $row3['hometown'];
			}
	break;
}



$query4 = "SELECT * FROM `efed_bio_history` WHERE bio_id = '$id'";
	if(!$result4 = mysql_query($query4)){ debug($query4); }
	if(mysql_num_rows($result4) == 0){
		$kowtitles = '';
		$kowawards = '';
	}
	else{
		while ($row4 = mysql_fetch_assoc($result4)){
			$kowtitles = $row4['kowtitles'];
			$kowawards = $row4['kowawards'];

		}
	}
?>
<div id="bio">

        <h1><?php echo $charname; ?>'s Biography</h1>
	<p class="biolinkpages"><a href="http://kansasoutlawwrestling.com/bio?username=<?php echo $username; ?>&page=wrestling">Wrestling</a> | <a href="http://kansasoutlawwrestling.com/bio?username=<?php echo $username; ?>&page=bio">Biography</a> | <a href="http://kansasoutlawwrestling.com/bio?username=<?php echo $username; ?>?page=appearances">Appearances</a> | <a href="http://kansasoutlawwrestling.com/bio?username=<?php echo $username; ?>?page=gallery">Gallery</a></p>


<?php
switch ($_GET['page']) {
    default:
		if(file_exists('images/fullshots/' . $posername . '.png')){
			echo '<img class="fullshot" src="images/fullshots/' . $posername . '.png" />';
		}
		else{
			echo '<img class="fullshot" src="images/fullshots/default.png" />';
		}
	?>
	<h2>Personal</h2>
<?php 
switch($style){
case 2: ?>
	<table class="biotable" cellspacing="10px">
		<tr class="biotablerowa">
			<td class="biotableheadingb">Height:</td>
			<td class="biotabledatab"><?php echo $height; ?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Weight:</td>
			<td class="biotabledatab"><?php echo $weight; ?></td>
		</tr>

		<tr class="biotablerowa">
			<td class="biotableheadingb">Hometown:</td>
			<td class="biotabledatab"><?php echo $hometown; ?></td>
		</tr>
	</table>
<?php	
break;

case 3: ?>
	<table class="biotable" cellspacing="10px">
		<tr class="biotablerowa">
			<td class="biotableheadingb">Nicknames:</td>
			<td class="biotabledatab"><?php if (strlen ($nicknames) < 1) { 	print "N/A"; } else { print "$nicknames";}?></td>
		</tr>

		<tr class="biotablerowa">
			<td class="biotableheadingb">Height:</td>
			<td class="biotabledatab"><?php echo $height; ?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Weight:</td>
			<td class="biotabledatab"><?php echo $weight; ?></td>
		</tr>

		<tr class="biotablerowa">
			<td class="biotableheadingb">Hometown:</td>
			<td class="biotabledatab"><?php echo $hometown; ?></td>
		</tr>
	</table>
<?php	
break;

case 4: ?>
	<table class="biotable" cellspacing="10px">
		<tr class="biotablerowa">
			<td class="biotableheadingb">Height:</td>
			<td class="biotabledatab"><?php echo $height; ?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Weight:</td>
			<td class="biotabledatab"><?php echo $weight; ?></td>
		</tr>

		<tr class="biotablerowa">
			<td class="biotableheadingb">Hometown:</td>
			<td class="biotabledatab"><?php echo $hometown; ?></td>
		</tr>
	</table>
<?php
break;

case 5: ?>
	<table class="biotable" cellspacing="10px">
		<tr class="biotablerowa">
			<td class="biotableheadingb">Height:</td>
			<td class="biotabledatab"><?php echo $height; ?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Weight:</td>
			<td class="biotabledatab"><?php echo $weight; ?></td>
		</tr>

		<tr class="biotablerowa">
			<td class="biotableheadingb">Hometown:</td>
			<td class="biotabledatab"><?php echo $hometown; ?></td>
		</tr>
	</table>
<?php	
break;
case 6: ?>
	<table class="biotable" cellspacing="10px">
		<tr class="biotablerowa">
			<td class="biotableheadingb">Height:</td>
			<td class="biotabledatab"><?php echo $height; ?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Weight:</td>
			<td class="biotabledatab"><?php echo $weight; ?></td>
		</tr>

		<tr class="biotablerowa">
			<td class="biotableheadingb">Hometown:</td>
			<td class="biotabledatab"><?php echo $hometown; ?></td>
		</tr>
	</table>
<?php	
break;

default: ?>
	<table class="biotable" cellspacing="10px">
		<tr class="biotablerowa">
			<td class="biotableheadingb">Nicknames:</td>
			<td class="biotabledatab"><?php if (strlen ($nicknames) < 1) { 	print "N/A"; } else { print "$nicknames";}?></td>
		</tr>

		<tr class="biotablerowa">
			<td class="biotableheadingb">Height:</td>
			<td class="biotabledatab"><?php echo $height; ?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Weight:</td>
			<td class="biotabledatab"><?php echo $weight; ?></td>
		</tr>

		<tr class="biotablerowa">
			<td class="biotableheadingb">Hometown:</td>
			<td class="biotabledatab"><?php echo $hometown; ?></td>
		</tr>
	</table>
<?php 
break;
}
?>
<h2>History</h2>
<?php 
switch($style){
case 2: ?>
	<table class="biotable" cellspacing="10px">
		<tr class="biotablerowb">
			<td class="biotableheadingb">KOW Titles:</td>
			<td class="biotabledatab"><?php if (strlen ($kowtitles) < 1) { 	print "N/A"; } else { print "$kowtitles";}?></td>
		</tr>

		<tr class="biotablerowa">
			<td class="biotableheadingb">KOW Awards:</td>
			<td class="biotabledatab"><?php if (strlen ($kowawards) < 1) { 	print "N/A"; } else { print "$kowawards";}?></td>
		</tr>
	</table>
<?php	
break;

case 3: ?>	
	<table class="biotable" cellspacing="10px">
		<tr class="biotablerowa">
			<td class="biotableheadingb">KOW Awards:</td>
			<td class="biotabledatab"><?php if (strlen ($kowawards) < 1) { 	print "N/A"; } else { print "$kowawards";}?></td>
		</tr>
	</table>
<?php	
break;	
case 4: ?>
	<table class="biotable" cellspacing="10px">
		<tr class="biotablerowa">
			<td class="biotableheadingb">KOW Awards:</td>
			<td class="biotabledatab"><?php if (strlen ($kowawards) < 1) { 	print "N/A"; } else { print "$kowawards";}?></td>
		</tr>
	</table>
<?php
break;
case 5: ?>
	<table class="biotable" cellspacing="10px">
		<tr class="biotablerowa">
			<td class="biotableheadingb">KOW Awards:</td>
			<td class="biotabledatab"><?php if (strlen ($kowawards) < 1) { 	print "N/A"; } else { print "$kowawards";}?></td>
		</tr>
	</table>
<?php	
break;
case 6: ?>
	<table class="biotable" cellspacing="10px">
		<tr class="biotablerowb">
			<td class="biotableheadingb">KOW Titles:</td>
			<td class="biotabledatab"><?php if (strlen ($kowtitles) < 1) { 	print "N/A"; } else { print "$kowtitles";}?></td>
		</tr>

		<tr class="biotablerowa">
			<td class="biotableheadingb">KOW Awards:</td>
			<td class="biotabledatab"><?php if (strlen ($kowawards) < 1) { 	print "N/A"; } else { print "$kowawards";}?></td>
		</tr>
	</table>
<?php	
break;
default: ?>
	<table class="biotable" cellspacing="10px">
		<tr class="biotablerowb">
			<td class="biotableheadingb">KOW Titles:</td>
			<td class="biotabledatab"><?php if (strlen ($kowtitles) < 1) { 	print "N/A"; } else { print "$kowtitles";}?></td>
		</tr>

		<tr class="biotablerowa">
			<td class="biotableheadingb">KOW Awards:</td>
			<td class="biotabledatab"><?php if (strlen ($kowawards) < 1) { 	print "N/A"; } else { print "$kowawards";}?></td>
		</tr>
	</table>
<?php	
break;
}
?>
<?php	
switch($style){
	case 2:?>
		<h2>Quotes</h2>
	<ul id="quotes">
		<?php
			if(count($quotes) > 0){
				for($i = 0; $i < count($quotes); $i++){
					echo "<li>".$quotes[$i]."</li>";
				}
			}
			else{
				echo '<li>This tag team has no quotes.</li>';
			}
		?>
	</ul>
	<?php
	break;
	case 3:?>
	<h2>Quotes</h2>
	<ul id="quotes">
		<?php
			if(count($quotes) > 0){
				for($i = 0; $i < count($quotes); $i++){
					echo "<li>".$quotes[$i]."</li>";
				}
			}
			else{
				echo '<li>This manager has no quotes.</li>';
			}
		?>
	</ul>	
	<?php 
	break;
	case 4:?>
	<?php
	break;
	case 5:?>
	<h2>Quotes</h2>
	<ul id="quotes">
		<?php
			if(count($quotes) > 0){
				for($i = 0; $i < count($quotes); $i++){
					echo "<li>".$quotes[$i]."</li>";
				}
			}
			else{
				echo '<li>This staffer has no quotes.</li>';
			}
		?>
	</ul>
	<?php
	break;
	case 6:?>
	<h2>Quotes</h2>
	<ul id="quotes">
		<?php
			if(count($quotes) > 0){
				for($i = 0; $i < count($quotes); $i++){
					echo "<li>".$quotes[$i]."</li>";
				}
			}
			else{
				echo '<li>This stable has no quotes.</li>';
			}
		?>
	</ul>
	<?php
	break;
	default:?>
	<h2>Quotes</h2>
	<ul id="quotes">
		<?php
			if(count($quotes) > 0){
				for($i = 0; $i < count($quotes); $i++){
					echo "<li>".$quotes[$i]."</li>";
				}
			}
			else{
				echo '<li>This wrestler has no quotes.</li>';
			}
		?>
	</ul>	
	<?php
	break;	
}		
?>	
<?php	
switch($style){
	case 2:?>
		<h2>Wrestling</h2>
		<table class="biotable" cellspacing="10px">
		<tr class="biotablerowb">
			<td class="biotableheadingb">Manager/Valet:</td>
			<td class="biotabledatab"><?php if (strlen ($manager) < 1) { 	print "N/A"; } else { print "$manager";}?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Finisher:</td>
			<td class="biotabledatab"><?php if (strlen ($finisher) < 1) { 	print "N/A"; } else { print "$finisher";}?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Setup:</td>
			<td class="biotabledatab"><?php if (strlen ($setup) < 1) { 	print "N/A"; } else { print "$setup";}?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Entrance Music:</td>
			<td class="biotabledatab"><?php if (strlen ($music) < 1) { 	print "N/A"; } else { print "$music";}?></td>
		</tr>
	</table>
	<?php
	break;
	case 3:?>
		<h2>Wrestling</h2>
		<table class="biotable" cellspacing="10px">
		<tr class="biotablerowb">
			<td class="biotableheadingb">Manages:</td>
			<td class="biotabledatab"><?php if (strlen ($manager) < 1) { 	print "N/A"; } else { print "$manager";}?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Entrance Music:</td>
			<td class="biotabledatab"><?php if (strlen ($music) < 1) { 	print "N/A"; } else { print "$music";}?></td>
		</tr>
	</table>
	<?php 
	break;
	case 4:?>
	<?php
	break;
	case 5:?>
	<?php
	break;
	case 6:?>
		<h2>Wrestling</h2>
		<table class="biotable" cellspacing="10px">
		<tr class="biotablerowb">
			<td class="biotableheadingb">Manager/Valet:</td>
			<td class="biotabledatab"><?php if (strlen ($manager) < 1) { 	print "N/A"; } else { print "$manager";}?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Finisher:</td>
			<td class="biotabledatab"><?php if (strlen ($finisher) < 1) { 	print "N/A"; } else { print "$finisher";}?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Setup:</td>
			<td class="biotabledatab"><?php if (strlen ($setup) < 1) { 	print "N/A"; } else { print "$setup";}?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Entrance Music:</td>
			<td class="biotabledatab"><?php if (strlen ($music) < 1) { 	print "N/A"; } else { print "$music";}?></td>
		</tr>
	</table>
	<?php
	break;
	default:?>
		<h2>Wrestling</h2>
		<table class="biotable" cellspacing="10px">
		<tr class="biotablerowb">
			<td class="biotableheadingb">Manager/Valet:</td>
			<td class="biotabledatab"><?php if (strlen ($manager) < 1) { 	print "N/A"; } else { print "$manager";}?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Finisher:</td>
			<td class="biotabledatab"><?php if (strlen ($finisher) < 1) { 	print "N/A"; } else { print "$finisher";}?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Setup:</td>
			<td class="biotabledatab"><?php if (strlen ($setup) < 1) { 	print "N/A"; } else { print "$setup";}?></td>
		</tr>

		<tr class="biotablerowb">
			<td class="biotableheadingb">Entrance Music:</td>
			<td class="biotabledatab"><?php if (strlen ($music) < 1) { 	print "N/A"; } else { print "$music";}?></td>
		</tr>
	</table>
	<?php
	break;	
}
    break;
    case 'bio':
        // etc.
    break;
    case 'appearances':
        // etc.
    break;
    case 'gallery':
        // etc.
    break;
}  
}		
?>
</div>

Link to comment
https://forums.phpfreaks.com/topic/214387-undefined-index/
Share on other sites

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.