Joshua F Posted January 2, 2010 Share Posted January 2, 2010 Sorry, for being like this, and posting a few topic over the same thing, but I have added onto my code. Added Code: <? if($_GET['t'] == 'id') { $id="{$_GET['hd']}"; if ($list_q = mysql_query("SELECT * FROM grandex WHERE id='$id'")) { if (mysql_num_rows($list_q)) { while($list_b=mysql_fetch_array($list_q)) { ?> <table width="70%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000"> <b><font size="5" face="Arial, Helvetica, sans-serif"><br /><?=$list_f['sitename'];?></font></b> <thread> <tr bordercolor="hh.png" class="tablee"> <th width="20%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item Name</font></b></div></th> <th width="15%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item ID</font></b></div></th> <th width="11%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Premium Member?</font></b></div></th> <th width="14%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Added on</font></b></div></th> <th width="15%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Status</font></b></div></th> </tr> </thread> <tr class="tablee"> <center><td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><b><?=$list_f['name'];?></b></font></center></td> <td width="21%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_f['itemid'];?></font></center></td> <td width="11%"><font size="2" face="Arial, Helvetica, sans-serif"><center></font></center></th> <td width="14%"><font size="2" face="Arial, Helvetica, sans-serif"><center> <?=$list_f['added'];?></font></center></td> <td width="15%"><font size="2" face="Arial, Helvetica, sans-serif"> <center><? if($list_f['prem'] == 0) { echo '<strong><font color="#FF0000">No</font></strong>'; }else{ echo '<strong><font color="#008000">Yes</font></strong>'; } ?> </font></td> </tr></center> <table width="70%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000"> <b><font size="3" face="Arial, Helvetica, sans-serif"><br />Other Info</font></b> <thread> <tr bordercolor="hh.png" class="tablee"> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Site ID</font></b></div></th> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Site Rank</font></b></div></th> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Site Type</font></b></div></th> </tr> </thread> <tr class="tablee"> <center><td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_f['id'];?></font></center></td> <td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center> <? if($list_f['prem'] == 1) { echo '<strong><font color="#FFD700">Golden</font></strong>'; }else{ echo '<strong><font color="#333333">Regular</font></strong>'; } ?> </font></td> <td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_f['sitetype'];?></font></center></td> </tr></center> <table width="15%" border="1" cellspacing="0" align="center" cellpadding="0" bordercolor="#000000"> <tr><br> <th bgcolor="#00b2ff" align="center"><b><font face="Arial, Helvetica, sans-serif" size="2"><font color="#FFFFFF">Same Window:</font></font></b></td> </tr> <tr> <td align="center"><font face="Arial, Helvetica, sans-serif" size="2"><font color="FFFFFF"><a href="http://<?=$list_f['sitehost'];?>"><?=$list_f['sitehost'];?></a></font></font></td> </tr> <th bgcolor="#00b2ff" align="center"><b><font face="Arial, Helvetica, sans-serif" size="2"><font color="#FFFFFF">New Window:</font></font></b></td> </tr> <tr> <td align="center"><font face="Arial, Helvetica, sans-serif" size="2"><font color="FFFFFF"><a href="http://<?=$list_f['sitehost'];?>" target="_blank"><?=$list_f['sitehost'];?></a></font></font></td> </tr> </table> <? } ?> And this is what my full page's code is... <?php include'config.php';?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>MagicPkz - Item Prices</title> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> <link rel="stylesheet" type="text/css" href="styles.css" /> </head> <body> <div class="container"> <div class="header"> <div class="sitename">MagicPkz</div> </div> <?php require_once("navagation.php") ?> <? if($_GET['t'] == 'id') { $id="{$_GET['hd']}"; if ($list_q = mysql_query("SELECT * FROM grandex WHERE id='$id'")) { if (mysql_num_rows($list_q)) { while($list_b=mysql_fetch_array($list_q)) { ?> <table width="70%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000"> <b><font size="5" face="Arial, Helvetica, sans-serif"><br /><?=$list_f['sitename'];?></font></b> <thread> <tr bordercolor="hh.png" class="tablee"> <th width="20%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item Name</font></b></div></th> <th width="15%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item ID</font></b></div></th> <th width="11%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Premium Member?</font></b></div></th> <th width="14%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Added on</font></b></div></th> <th width="15%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Status</font></b></div></th> </tr> </thread> <tr class="tablee"> <center><td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><b><?=$list_f['name'];?></b></font></center></td> <td width="21%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_f['itemid'];?></font></center></td> <td width="11%"><font size="2" face="Arial, Helvetica, sans-serif"><center></font></center></th> <td width="14%"><font size="2" face="Arial, Helvetica, sans-serif"><center> <?=$list_f['added'];?></font></center></td> <td width="15%"><font size="2" face="Arial, Helvetica, sans-serif"> <center><? if($list_f['prem'] == 0) { echo '<strong><font color="#FF0000">No</font></strong>'; }else{ echo '<strong><font color="#008000">Yes</font></strong>'; } ?> </font></td> </tr></center> <table width="70%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000"> <b><font size="3" face="Arial, Helvetica, sans-serif"><br />Other Info</font></b> <thread> <tr bordercolor="hh.png" class="tablee"> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Site ID</font></b></div></th> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Site Rank</font></b></div></th> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Site Type</font></b></div></th> </tr> </thread> <tr class="tablee"> <center><td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_f['id'];?></font></center></td> <td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center> <? if($list_f['prem'] == 1) { echo '<strong><font color="#FFD700">Golden</font></strong>'; }else{ echo '<strong><font color="#333333">Regular</font></strong>'; } ?> </font></td> <td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_f['sitetype'];?></font></center></td> </tr></center> <table width="15%" border="1" cellspacing="0" align="center" cellpadding="0" bordercolor="#000000"> <tr><br> <th bgcolor="#00b2ff" align="center"><b><font face="Arial, Helvetica, sans-serif" size="2"><font color="#FFFFFF">Same Window:</font></font></b></td> </tr> <tr> <td align="center"><font face="Arial, Helvetica, sans-serif" size="2"><font color="FFFFFF"><a href="http://<?=$list_f['sitehost'];?>"><?=$list_f['sitehost'];?></a></font></font></td> </tr> <th bgcolor="#00b2ff" align="center"><b><font face="Arial, Helvetica, sans-serif" size="2"><font color="#FFFFFF">New Window:</font></font></b></td> </tr> <tr> <td align="center"><font face="Arial, Helvetica, sans-serif" size="2"><font color="FFFFFF"><a href="http://<?=$list_f['sitehost'];?>" target="_blank"><?=$list_f['sitehost'];?></a></font></font></td> </tr> </table> <? } ?> <!--Start of Main--> <table class="tables" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000" id="resultTable"> <b><font size="3" face="Arial, Helvetica, sans-serif"><br /><br /><center>Item List</center></font></b> <thead> <tr bordercolor="hh.png" bgcolor="#000000"> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item Name</font></b></div></th> <th width="30%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item ID</font></b></div></th> <th width="11%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Premium Member?</font></b></div></th> </tr> </thead> <?php if ($list_q = mysql_query("SELECT * FROM grandex ORDER BY name desc")) { if (mysql_num_rows($list_q)) { while($list_b=mysql_fetch_array($list_q)) { ?> <tbody> <tr class="tablee"> <td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><b><?=$list_b['name'];?></b></font></td></center> <td width="30%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_b['itemid'];?></center></font></td> <td width="11%"><font size="2" face="Arial, Helvetica, sans-serif"><center> <? if($list_f['prem'] == 0) { echo '<strong><font color="#FF0000">No</font></strong>'; }else{ echo '<strong><font color="#008000">Yes</font></strong>'; } ?></font></td></center> </tr> </tbody> <?php } } else { echo "<center><b>No Items In Database.<br>Please Check Back Later.</b></center>"; } } else { trigger_error(mysql_error()); } ?> <!--End of Main--> </div> </div> </body> </html> The error is... Parse error: syntax error, unexpected $end in /home/mpz/public_html/ge/index.php on line 118 Sorry if this is to much. Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/ Share on other sites More sharing options...
The Little Guy Posted January 2, 2010 Share Posted January 2, 2010 The error is most likely displaying because you are missing one or more closing braces "}" make sure you have the same number of each. Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/#findComment-987013 Share on other sites More sharing options...
Deoctor Posted January 2, 2010 Share Posted January 2, 2010 is this ur complete index page??? Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/#findComment-987014 Share on other sites More sharing options...
Deoctor Posted January 2, 2010 Share Posted January 2, 2010 change it like this might be it work.. <?php include'config.php';?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>MagicPkz - Item Prices</title> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> <link rel="stylesheet" type="text/css" href="styles.css" /> </head> <body> <div class="container"> <div class="header"> <div class="sitename">MagicPkz</div> </div> <?php require_once("navagation.php") ?> <? if($_GET['t'] == 'id') { $id="{$_GET['hd']}"; if ($list_q = mysql_query("SELECT * FROM grandex WHERE id='$id'")) { if (mysql_num_rows($list_q)) { while($list_b=mysql_fetch_array($list_q)) { ?> <table width="70%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000"> <b><font size="5" face="Arial, Helvetica, sans-serif"><br /><?=$list_f['sitename'];?></font></b> <thread> <tr bordercolor="hh.png" class="tablee"> <th width="20%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item Name</font></b></div></th> <th width="15%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item ID</font></b></div></th> <th width="11%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Premium Member?</font></b></div></th> <th width="14%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Added on</font></b></div></th> <th width="15%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Status</font></b></div></th> </tr> </thread> <tr class="tablee"> <center><td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><b><?=$list_f['name'];?></b></font></center></td> <td width="21%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_f['itemid'];?></font></center></td> <td width="11%"><font size="2" face="Arial, Helvetica, sans-serif"><center></font></center></th> <td width="14%"><font size="2" face="Arial, Helvetica, sans-serif"><center> <?=$list_f['added'];?></font></center></td> <td width="15%"><font size="2" face="Arial, Helvetica, sans-serif"> <center><? if($list_f['prem'] == 0) { echo '<strong><font color="#FF0000">No</font></strong>'; }else{ echo '<strong><font color="#008000">Yes</font></strong>'; } ?> </font></td> </tr></center> <table width="70%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000"> <b><font size="3" face="Arial, Helvetica, sans-serif"><br />Other Info</font></b> <thread> <tr bordercolor="hh.png" class="tablee"> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Site ID</font></b></div></th> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Site Rank</font></b></div></th> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Site Type</font></b></div></th> </tr> </thread> <tr class="tablee"> <center><td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_f['id'];?></font></center></td> <td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center> <? if($list_f['prem'] == 1) { echo '<strong><font color="#FFD700">Golden</font></strong>'; }else{ echo '<strong><font color="#333333">Regular</font></strong>'; } ?> </font></td> <td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_f['sitetype'];?></font></center></td> </tr></center> <table width="15%" border="1" cellspacing="0" align="center" cellpadding="0" bordercolor="#000000"> <tr><br> <th bgcolor="#00b2ff" align="center"><b><font face="Arial, Helvetica, sans-serif" size="2"><font color="#FFFFFF">Same Window:</font></font></b></td> </tr> <tr> <td align="center"><font face="Arial, Helvetica, sans-serif" size="2"><font color="FFFFFF"><a href="http://<?=$list_f['sitehost'];?>"><?=$list_f['sitehost'];?></a></font></font></td> </tr> <th bgcolor="#00b2ff" align="center"><b><font face="Arial, Helvetica, sans-serif" size="2"><font color="#FFFFFF">New Window:</font></font></b></td> </tr> <tr> <td align="center"><font face="Arial, Helvetica, sans-serif" size="2"><font color="FFFFFF"><a href="http://<?=$list_f['sitehost'];?>" target="_blank"><?=$list_f['sitehost'];?></a></font></font></td> </tr> </table> <? } } } } ?> <!--Start of Main--> <table class="tables" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000" id="resultTable"> <b><font size="3" face="Arial, Helvetica, sans-serif"><br /><br /><center>Item List</center></font></b> <thead> <tr bordercolor="hh.png" bgcolor="#000000"> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item Name</font></b></div></th> <th width="30%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item ID</font></b></div></th> <th width="11%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Premium Member?</font></b></div></th> </tr> </thead> <?php if ($list_q = mysql_query("SELECT * FROM grandex ORDER BY name desc")) { if (mysql_num_rows($list_q)) { while($list_b=mysql_fetch_array($list_q)) { ?> <tbody> <tr class="tablee"> <td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><b><?=$list_b['name'];?></b></font></td></center> <td width="30%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_b['itemid'];?></center></font></td> <td width="11%"><font size="2" face="Arial, Helvetica, sans-serif"><center> <? if($list_f['prem'] == 0) { echo '<strong><font color="#FF0000">No</font></strong>'; }else{ echo '<strong><font color="#008000">Yes</font></strong>'; } ?></font></td></center> </tr> </tbody> <?php } } else { echo "<center><b>No Items In Database.<br>Please Check Back Later.</b></center>"; } } else { trigger_error(mysql_error()); } ?> <!--End of Main--> </div> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/#findComment-987016 Share on other sites More sharing options...
Joshua F Posted January 2, 2010 Author Share Posted January 2, 2010 Okay, that fixed the error. But when i try to do the ?t=id&hd=1 or so, It still has the stuff that should only be on the main page(Example: http://magicpkz.com/ge/index.php?t=id&hd=1). Thanks, Josh Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/#findComment-987019 Share on other sites More sharing options...
Deoctor Posted January 2, 2010 Share Posted January 2, 2010 Okay, that fixed the error. But when i try to do the ?t=id&hd=1 or so, It still has the stuff that should only be on the main page(Example: http://magicpkz.com/ge/index.php?t=id&hd=1). Thanks, Josh :confused: :confused: :confused: could nt able to get wt u r talking abt.. Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/#findComment-987020 Share on other sites More sharing options...
Joshua F Posted January 2, 2010 Author Share Posted January 2, 2010 Okay, that fixed the error. But when i try to do the ?t=id&hd=1 or so, It still has the stuff that should only be on the main page(Example: http://magicpkz.com/ge/index.php?t=id&hd=1). Thanks, Josh :confused: :confused: :confused: could nt able to get wt u r talking abt.. I have it so that it is like a profile for the "Item". And the link to one would be like http://magicpkz.com/ge/index.php?t=&id=1. I'll make a picture, hold on. Edit: Red = Not Meant To Be There Green = Fine As Is. Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/#findComment-987021 Share on other sites More sharing options...
oni-kun Posted January 2, 2010 Share Posted January 2, 2010 What do you mean? At the beginning of the page, run an IF statement telling it to not output the unwanted data if the $_GET properties are as they are, this will prevent the unwanted content! Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/#findComment-987034 Share on other sites More sharing options...
Joshua F Posted January 2, 2010 Author Share Posted January 2, 2010 Ha, no idea how to do that, Im still a beginner at php. getting better though. :/. Thanks, Josh Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/#findComment-987037 Share on other sites More sharing options...
oni-kun Posted January 2, 2010 Share Posted January 2, 2010 Ha, no idea how to do that, Im still a beginner at php. getting better though. :/. Thanks, Josh if (isset($_GET['id']) && $_GET['id'] == '1') { echo 'Page ID: ' . $_GET['id']; //Info you wanted //Page code.. } else { echo "Default page"; //Info you wanted to omit //etc.. } If you structure it like that, you won't get the (included) default page you didn't want? Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/#findComment-987038 Share on other sites More sharing options...
Joshua F Posted January 2, 2010 Author Share Posted January 2, 2010 So, how exactly would I add that? :/. Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/#findComment-987263 Share on other sites More sharing options...
oni-kun Posted January 2, 2010 Share Posted January 2, 2010 So, how exactly would I add that? :/. It's simple. When you wanted to display somerthing else (IE: index.php?t=&id=1) you used it to echo data to the page, right? But from what I've seen you set it up so it displays the default content no matter what. Simply make it, so if 'id' exists in $_GET, such as the ID they're viewing, to NOT display the default data (isset($_GET['id']). Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/#findComment-987278 Share on other sites More sharing options...
Joshua F Posted January 2, 2010 Author Share Posted January 2, 2010 Oh, okay. But I've changed it a bit to help out my users though, It does still say it on all pages, but It only has 5. And now there is a link to view all of them(the 5 are the last 5 added). So thanks oni-kun! Thanks, Josh Quote Link to comment https://forums.phpfreaks.com/topic/186904-error/#findComment-987283 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.