SelfObscurity Posted May 29, 2007 Share Posted May 29, 2007 I have placed a page together, and I am getting an error: Parse error: syntax error, unexpected $end in /home/jedney/public_html/beta/index.php on line 284 Line 284 is the last line of code on my page, so I've spend the last hour or so double-checking my code, and still have come up with nothing. I am not a PHP-guru, so I figured I would post my code, and maybe someone can see my mistake. Thank you in advance. <?php // Page information will go here if ($_GET['page'] == 'news') { if (isset($_GET['id']) ) { $query="SELECT * FROM news WHERE id = '{$_GET['id']}'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td bgcolor=\"003366\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#F1F1F1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br /> <table width=\"775\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" align=\"center\"> <tr> <td bgcolor=\"#FFFFFF\"><div align=\"left\"><strong><span class=\"style1\"><p><strong><span class=\"style1\">".$row['heading']."</span></strong></p> <p align=\"left\" class=\"style1\">".$row['location']." ".$row['date']." -</strong> ".$row['extcontent']." <br /> </p> <hr /></span></strong><span class=\"style1\"></span></div></TD></TR></TBODY></TABLE> </TD> </TR></TBODY></TABLE> <br></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>"); }else { $query="SELECT * FROM news"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) echo ("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td bgcolor=\"003366\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#F1F1F1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br /> <table width=\"775\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" align=\"center\"> <tr> <td bgcolor=\"#FFFFFF\"><a href='index2.php?page=news&id=".$row['id']."'><strong><span class=\"style1\">".$row['date']." - ".$row['heading']."</span></strong></a></span></strong><span class=\"style1\"></span></div></TD></TR></TBODY></TABLE> </TD> </TR></TBODY></TABLE> <br></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>"); } if ($_GET['page'] == 'company') { $query="SELECT * FROM company"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td bgcolor=\"003366\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#F1F1F1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br /> <table width=\"775\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" align=\"center\"> <tr> <td bgcolor=\"#FFFFFF\"><span class=\"style1\">".$row['overview']."<br /> </span></div><br></TD></TR></TBODY></TABLE> </TD> </TR></TBODY></TABLE> <br></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> "); } else { echo("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#003366\">"); echo("<tr>"); echo("<td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">"); echo("<tr>"); echo("<td><table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">"); echo("<tr>"); echo("<td width=\"67%\" align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br />"); echo("<table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); echo("<tr>"); echo("<td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"); echo("<tr>"); echo("<td bgcolor=\"#FFFFFF\"><div align=\"center\">"); // This is the date information for the greeting mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM homegreet"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<span class=\"style1\"><strong>".$row['heading']."<br /> </strong><span class=\"style1\">".$row['content']."<br /> </span></div>"); echo("</td>"); echo("</tr>"); echo("</table></td>"); echo("</tr>"); echo("</table>"); echo("<br />"); echo("<table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); echo("<tr>"); echo("<td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"); echo("<tr>"); echo("<td bgcolor=\"#FFFFFF\">"); echo("<strong><span class=\"style1\">Our Featured Client<br />"); echo("</span></strong>"); // This is the date information for the Featured Client mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM featureclient"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<span class=\"style1\"><a href=".$row['url']." target=\"_blank\">".$row['client']."</a><br /> ".$row['desc']."</span></div>"); echo ("</td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table>"); echo ("<br /></td>"); echo ("<td width=\"33%\" align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br />"); echo ("<table width=\"200\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); echo ("<tr>"); echo ("<td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"); echo ("<tr>"); echo ("<td bgcolor=\"#FFFFFF\"><div align=\"center\">"); // This is the date information for the company news mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM news LIMIT 0,5"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo ("<p><strong><span class=\"style1\">".$row['heading']."</span></strong></p> <p align=\"left\" class=\"style1\">".$row['location']." ".$row['date']." - ".$row['content']." <br /> <a href='index.php?page=news&id=".$row['id']."'>Read on</a>.<br /> </p> <hr /> </div>"); } echo ("</td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table>"); echo ("<div align=\"center\" class=\"style1\"><span class=\"style8\"><br />"); echo ("</span></div>"); echo ("<div align=\"center\" class=\"style1\">"); } ?> <? echo ("<div align=\"center\" class=\"style1\">"); // FOOTER mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM footer"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("".$row['content']."<br><a href=".$row['agreeurl'].">".$row['agreetxt']."</a> - <a href=".$row['privacyurl'].">".$row['privacytxt']."</a><br><br>Tantrum Internet, ".$row['address']."<br>Phone ".$row['phone']." - Fax ".$row['fax'].""); echo ("</div>"); echo ("</body>"); echo ("</html>"); { ?> I am assuming from the error, I have a bracket out of place, but I cannot be sure. I guess what I'm looking for is the error for one, and possible for someone to give me some adivce as to how the coding looks, and if I could do anything different with it to save time/lines/server load. Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/ Share on other sites More sharing options...
thegod Posted May 29, 2007 Share Posted May 29, 2007 this is common it a curly bracket missing somewhere in the coding make sure all your backets are right Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264284 Share on other sites More sharing options...
MadTechie Posted May 29, 2007 Share Posted May 29, 2007 REMOVED Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264287 Share on other sites More sharing options...
eric1235711 Posted May 29, 2007 Share Posted May 29, 2007 yes, It's missing a curly bracket... find it by your self, it's not that hard... Just and advice: Your code is a little messy... Go identing your code, you will find it at a glance. the last bracket is wrong and also it looks like is missing one closing bracket in the beginning. Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264289 Share on other sites More sharing options...
MadTechie Posted May 29, 2007 Share Posted May 29, 2007 lol good point (plus line number) remove my first post NOTE { = open } = CLOSE Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264291 Share on other sites More sharing options...
thegod Posted May 29, 2007 Share Posted May 29, 2007 try this <?php // Page information will go here if ($_GET['page'] == 'news') { if (isset($_GET['id']) ) { $query="SELECT * FROM news WHERE id = '{$_GET['id']}'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td bgcolor=\"003366\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#F1F1F1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br /> <table width=\"775\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" align=\"center\"> <tr> <td bgcolor=\"#FFFFFF\"><div align=\"left\"><strong><span class=\"style1\"><p><strong><span class=\"style1\">".$row['heading']."</span></strong></p> <p align=\"left\" class=\"style1\">".$row['location']." ".$row['date']." -</strong> ".$row['extcontent']." <br /> </p> <hr /></span></strong><span class=\"style1\"></span></div></TD></TR></TBODY></TABLE> </TD> </TR></TBODY></TABLE> <br></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>"); }else { $query="SELECT * FROM news"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) echo ("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td bgcolor=\"003366\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#F1F1F1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br /> <table width=\"775\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" align=\"center\"> <tr> <td bgcolor=\"#FFFFFF\"><a href='index2.php?page=news&id=".$row['id']."'><strong><span class=\"style1\">".$row['date']." - ".$row['heading']."</span></strong></a></span></strong><span class=\"style1\"></span></div></TD></TR></TBODY></TABLE> </TD> </TR></TBODY></TABLE> <br></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>"); } if ($_GET['page'] == 'company') { $query="SELECT * FROM company"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td bgcolor=\"003366\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#F1F1F1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br /> <table width=\"775\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" align=\"center\"> <tr> <td bgcolor=\"#FFFFFF\"><span class=\"style1\">".$row['overview']."<br /> </span></div><br></TD></TR></TBODY></TABLE> </TD> </TR></TBODY></TABLE> <br></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> "); } else { echo("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#003366\">"); echo("<tr>"); echo("<td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">"); echo("<tr>"); echo("<td><table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">"); echo("<tr>"); echo("<td width=\"67%\" align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br />"); echo("<table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); echo("<tr>"); echo("<td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"); echo("<tr>"); echo("<td bgcolor=\"#FFFFFF\"><div align=\"center\">"); // This is the date information for the greeting mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM homegreet"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<span class=\"style1\"><strong>".$row['heading']."<br /> </strong><span class=\"style1\">".$row['content']."<br /> </span></div>"); echo("</td>"); echo("</tr>"); echo("</table></td>"); echo("</tr>"); echo("</table>"); echo("<br />"); echo("<table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); echo("<tr>"); echo("<td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"); echo("<tr>"); echo("<td bgcolor=\"#FFFFFF\">"); echo("<strong><span class=\"style1\">Our Featured Client<br />"); echo("</span></strong>"); // This is the date information for the Featured Client mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM featureclient"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<span class=\"style1\"><a href=".$row['url']." target=\"_blank\">".$row['client']."</a><br /> ".$row['desc']."</span></div>"); echo ("</td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table>"); echo ("<br /></td>"); echo ("<td width=\"33%\" align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br />"); echo ("<table width=\"200\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); echo ("<tr>"); echo ("<td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"); echo ("<tr>"); echo ("<td bgcolor=\"#FFFFFF\"><div align=\"center\">"); // This is the date information for the company news mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM news LIMIT 0,5"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo ("<p><strong><span class=\"style1\">".$row['heading']."</span></strong></p> <p align=\"left\" class=\"style1\">".$row['location']." ".$row['date']." - ".$row['content']." <br /> <a href='index.php?page=news&id=".$row['id']."'>Read on</a>.<br /> </p> <hr /> </div>"); } echo ("</td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table>"); echo ("<div align=\"center\" class=\"style1\"><span class=\"style8\"><br />"); echo ("</span></div>"); echo ("<div align=\"center\" class=\"style1\">"); } ?> <? echo ("<div align=\"center\" class=\"style1\">"); // FOOTER mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM footer"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("".$row['content']."<br><a href=".$row['agreeurl'].">".$row['agreetxt']."</a> - <a href=".$row['privacyurl'].">".$row['privacytxt']."</a><br><br>Tantrum Internet, ".$row['address']."<br>Phone ".$row['phone']." - Fax ".$row['fax'].""); echo ("</div>"); echo ("</body>"); echo ("</html>"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264292 Share on other sites More sharing options...
MadTechie Posted May 29, 2007 Share Posted May 29, 2007 USE CODE TAGS DOES ANYONE READ THE RULES Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264295 Share on other sites More sharing options...
SelfObscurity Posted May 29, 2007 Author Share Posted May 29, 2007 thegod: Thanks. That works and will show, but after that last }else{, isn't that supposed to show if the page is simply index.php? It doesn't show, but it shows up with the other stuff, which I don't understand. I think I may recode the whole thing. Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264337 Share on other sites More sharing options...
rhyspaterson Posted May 29, 2007 Share Posted May 29, 2007 http://formatter.gerbenvv.nl/version3/index.php?lang=en Formats *and* checks your code for syntax errors Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264346 Share on other sites More sharing options...
SelfObscurity Posted May 29, 2007 Author Share Posted May 29, 2007 rhyspaterson: Great program, I added that to my favorites. Same problem still though. Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264356 Share on other sites More sharing options...
MadTechie Posted May 29, 2007 Share Posted May 29, 2007 try this <?php // Page information will go here if ($_GET['page'] == 'news') { if (isset($_GET['id']) ) { $query="SELECT * FROM news WHERE id = '{$_GET['id']}'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td bgcolor=\"003366\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#F1F1F1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br /> <table width=\"775\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" align=\"center\"> <tr> <td bgcolor=\"#FFFFFF\"><div align=\"left\"><strong><span class=\"style1\"><p><strong><span class=\"style1\">".$row['heading']."</span></strong></p> <p align=\"left\" class=\"style1\">".$row['location']." ".$row['date']." -</strong> ".$row['extcontent']." <br /> </p> <hr /></span></strong><span class=\"style1\"></span></div></TD></TR></TBODY></TABLE> </TD> </TR></TBODY></TABLE> <br></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>"); }else { $query="SELECT * FROM news"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) echo ("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td bgcolor=\"003366\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#F1F1F1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br /> <table width=\"775\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" align=\"center\"> <tr> <td bgcolor=\"#FFFFFF\"><a href='index2.php?page=news&id=".$row['id']."'><strong><span class=\"style1\">".$row['date']." - ".$row['heading']."</span></strong></a></span></strong><span class=\"style1\"></span></div></TD></TR></TBODY></TABLE> </TD> </TR></TBODY></TABLE> <br></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>"); } } if ($_GET['page'] == 'company') { $query="SELECT * FROM company"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td bgcolor=\"003366\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#F1F1F1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br /> <table width=\"775\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" align=\"center\"> <tr> <td bgcolor=\"#FFFFFF\"><span class=\"style1\">".$row['overview']."<br /> </span></div><br></TD></TR></TBODY></TABLE> </TD> </TR></TBODY></TABLE> <br></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> "); } else { echo("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#003366\">"); echo("<tr>"); echo("<td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">"); echo("<tr>"); echo("<td><table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">"); echo("<tr>"); echo("<td width=\"67%\" align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br />"); echo("<table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); echo("<tr>"); echo("<td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"); echo("<tr>"); echo("<td bgcolor=\"#FFFFFF\"><div align=\"center\">"); // This is the date information for the greeting mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM homegreet"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<span class=\"style1\"><strong>".$row['heading']."<br /> </strong><span class=\"style1\">".$row['content']."<br /> </span></div>"); echo("</td>"); echo("</tr>"); echo("</table></td>"); echo("</tr>"); echo("</table>"); echo("<br />"); echo("<table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); echo("<tr>"); echo("<td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"); echo("<tr>"); echo("<td bgcolor=\"#FFFFFF\">"); echo("<strong><span class=\"style1\">Our Featured Client<br />"); echo("</span></strong>"); // This is the date information for the Featured Client mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM featureclient"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("<span class=\"style1\"><a href=".$row['url']." target=\"_blank\">".$row['client']."</a><br /> ".$row['desc']."</span></div>"); echo ("</td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table>"); echo ("<br /></td>"); echo ("<td width=\"33%\" align=\"center\" valign=\"top\" bgcolor=\"#F1F1F1\"><br />"); echo ("<table width=\"200\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); echo ("<tr>"); echo ("<td bgcolor=\"#003366\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">"); echo ("<tr>"); echo ("<td bgcolor=\"#FFFFFF\"><div align=\"center\">"); // This is the date information for the company news mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM news LIMIT 0,5"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo ("<p><strong><span class=\"style1\">".$row['heading']."</span></strong></p> <p align=\"left\" class=\"style1\">".$row['location']." ".$row['date']." - ".$row['content']." <br /> <a href='index.php?page=news&id=".$row['id']."'>Read on</a>.<br /> </p> <hr /> </div>"); } echo ("</td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table></td>"); echo ("</tr>"); echo ("</table>"); echo ("<div align=\"center\" class=\"style1\"><span class=\"style8\"><br />"); echo ("</span></div>"); echo ("<div align=\"center\" class=\"style1\">"); } echo ("<div align=\"center\" class=\"style1\">"); // FOOTER mysql_connect($Host,$User,$Pass); @mysql_select_db($DB) or die ("Unable to select requested database."); $query="SELECT * FROM footer"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo ("".$row['content']."<br><a href=".$row['agreeurl'].">".$row['agreetxt']."</a> - <a href=".$row['privacyurl'].">".$row['privacytxt']."</a><br><br>Tantrum Internet, ".$row['address']."<br>Phone ".$row['phone']." - Fax ".$row['fax'].""); echo ("</div>"); echo ("</body>"); echo ("</html>"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264358 Share on other sites More sharing options...
SelfObscurity Posted May 30, 2007 Author Share Posted May 30, 2007 MadTechie: That worked, thank you. But, the only problem now, is the main page is showing up on all the pages I go to. Line 184 is } else { and I thought, that would signal the site to understand, that I only want to show it if none of the variables are present. Instead, that code after it is present in all the instances. How is that possible? Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264364 Share on other sites More sharing options...
MadTechie Posted May 30, 2007 Share Posted May 30, 2007 change } else { to } if ( !isset($_GET['page']) ) { Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264368 Share on other sites More sharing options...
SelfObscurity Posted May 30, 2007 Author Share Posted May 30, 2007 That worked. Thank you very much. Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264370 Share on other sites More sharing options...
conker87 Posted May 30, 2007 Share Posted May 30, 2007 Just a quick suggestion for SelfObscurity. If you have a large amount of html that needs echoing, close the php tag and just write out the html like you'd do then open the tag again once the html is done. Example, it's not a large amount of text, but it's still shows the point: <?php { while ($row = mysql_fetch_array($result)) { $author = $row['author']; $title = $row['title']; $date = $row['date']; $data = $row['data']; ?> <h2><?=$title; ?></h2> <blockquote><?=$date; ?>, by <b><?=$author; ?></b><br /> <?=$data; ?></blockquote> <?php } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/53472-solved-my-parse-error-problem/#findComment-264392 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.