bslevin Posted July 30, 2006 Share Posted July 30, 2006 Hello, I am very new to PHP and i am having a problem with a script i have. It is a simple "diary / news" script which you enter a subject and body and it displays on the page.I have moved the script to a test directory becuse it is in a protected members area normally.the problem i am having is there is an entry posted every week (starting back from the begining of the year) to the present. At the bottom of the page there is a drop down to see past "archived" months. This does not work, if you select a month you get an error in IE - the error is belowLine: 80Char: 1Error: Object expectedCode: 0URL: http://www.kingoftheheel.com/test/news.phpthe link is http://www.kingoftheheel.com/test/news.php If anyone has any idea, it would be greatly appreciated, the person who wrote the script cannot be found.Thanks in advanceBill Quote Link to comment https://forums.phpfreaks.com/topic/16053-need-help-with-a-php-error/ Share on other sites More sharing options...
trq Posted July 30, 2006 Share Posted July 30, 2006 You might want to post some code! Quote Link to comment https://forums.phpfreaks.com/topic/16053-need-help-with-a-php-error/#findComment-66127 Share on other sites More sharing options...
bslevin Posted July 30, 2006 Author Share Posted July 30, 2006 Sorry about that here is the whole page:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head> <title></title> <link rel=stylesheet type=text/css href="styles.css"> <style type="text/css"> A:link { color:#ffffcc; } A:visited { color:#ffffcc; } A:hover { color:red; }BODY { FONT-SIZE: 12px; FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif;SCROLLBAR-BASE-COLOR: #492263; SCROLLBAR-ARROW-COLOR: #ffff66; /*SCROLLBAR-3DLIGHT-COLOR: #000000; SCROLLBAR-HIGHLIGHT-COLOR: #FF9999;SCROLLBAR-SHADOW-COLOR: #FF9999; SCROLLBAR-DARKSHADOW-COLOR: #660000;SCROLLBAR-FACE-COLOR: #ffff66; SCROLLBAR-TRACK-COLOR: #000000;*/</style> </head><body background="../images/stretch.jpg" bgcolor="Black" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 text="White" link="#ffffcc" vlink="#ffffcc" alink="#ffffcc"><table width="760" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td><img src="../images/blank.jpg" width="760" height="16" alt="" border="0"></td> </tr> <tr> <td valign="top"> <table width="760" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#492263"> <tr bgcolor=492263><td align=center><br><strong class=black-large>News and Updates Page</strong><br><br></td></tr> <tr> <td><br> <? include ("common.php"); MYSQL_CONNECT($hostname,$username,$passwrd) OR DIE("Oh damn! Couldnt connect to the database, sorry mate!"); @mysql_select_db($dbName) or die("<strong class=black-large>Unable to select database</strong>"); if ($month) { $sortby = " WHERE $maintable.month='" . $month . "' " ; $limit = " ";} else {$sortby = " "; } $query = " SELECT $maintable.id, $maintable.thedate, $maintable.topic, $maintable.entry, count($commentstable.id) AS comments FROM $maintable LEFT OUTER JOIN $commentstable ON $maintable.id = $commentstable.id $sortby GROUP BY $maintable.id ORDER BY $maintable.id DESC $limit"; $result = mysql_query($query) or die("<strong class=black-large>Whoops! Something wrong happened to the my database! It would be nice if you emailed <a href=mailto:$webmaster>me</a> and told me!</strong>"); if ($result) { echo "<table border=0 cellspacing=0 cellpadding=5 width=$width align=center>"; while ($r = mysql_fetch_array($result)) { extract($r); $entry = nl2br($entry); echo " <tr bgcolor=492263><td><strong class=black>$topic</strong></td><td align=right><strong class=black>$thedate</strong></td></tr> <tr bgcolor=492263><td colspan=2><small class=black-small>$entry</small><br></td></tr> <tr bgcolor=492263><td colspan=2><hr color=ffffff size=1 width=100%></td></tr> "; } echo "</table><br>"; mysql_free_result($result);} $query2 = "SELECT month FROM $maintable GROUP BY month ORDER BY id"; $result2 = mysql_query($query2) or die("<strong class=black-large>Whoops! Something wrong happened to the my database! It would be nice if you emailed <a href=mailto:$webmaster>me</a> and told me!</strong>"); if ($result2) { echo "<form><table border=0 cellspacing=0 cellpadding=5 width=$width align=center> <td align=right colspan=2 valign=top> <select onchange=\"GoUrl(this)\"> <option> previous news entries for: <option> "; while ($r2 = mysql_fetch_array($result2)) { extract($r2); echo "<option value=news.php?month=$month><strong class=black-small> -> $month </strong>"; } echo "</select> </td> </tr></table></form> "; mysql_free_result($result2); } mysql_close(); ?> </td> </tr> </table> </td> </tr> <tr> <td><br></td> </tr> <tr> <td></td> </tr></table></body></html> Quote Link to comment https://forums.phpfreaks.com/topic/16053-need-help-with-a-php-error/#findComment-66129 Share on other sites More sharing options...
trq Posted July 30, 2006 Share Posted July 30, 2006 The error states line 80, please narrow it down some. A few lines before and after should suffice.PS; Also... please use the [ php ] [ / php ] tags (no space). Quote Link to comment https://forums.phpfreaks.com/topic/16053-need-help-with-a-php-error/#findComment-66130 Share on other sites More sharing options...
bslevin Posted July 30, 2006 Author Share Posted July 30, 2006 Ok here is line 77 - 96$query2 = "SELECT month FROM $maintable GROUP BY month ORDER BY id"; $result2 = mysql_query($query2) or die("<strong class=black-large>Whoops! Something wrong happened to the my database! It would be nice if you emailed <a href=mailto:$webmaster>me</a> and told me!</strong>"); if ($result2) { echo "<form><table border=0 cellspacing=0 cellpadding=5 width=$width align=center> <td align=right colspan=2 valign=top> <select onchange=\"GoUrl(this)\"> <option> previous news entries for: <option> "; while ($r2 = mysql_fetch_array($result2)) { extract($r2); echo "<option value=news.php?month=$month><strong class=black-small> -> $month </strong>"; } echo "</select> </td> </tr></table></form> "; mysql_free_result($result2); } mysql_close(); Quote Link to comment https://forums.phpfreaks.com/topic/16053-need-help-with-a-php-error/#findComment-66131 Share on other sites More sharing options...
trq Posted July 30, 2006 Share Posted July 30, 2006 Actualy... the error you post seems to be a Javascript one, nothing to do with php. Where have you defined the GoUrl() function? Quote Link to comment https://forums.phpfreaks.com/topic/16053-need-help-with-a-php-error/#findComment-66132 Share on other sites More sharing options...
bslevin Posted July 30, 2006 Author Share Posted July 30, 2006 [quote author=thorpe link=topic=102372.msg406202#msg406202 date=1154297412]Actualy... the error you post seems to be a Javascript one, nothing to do with php. Where have you defined the GoUrl() function?[/quote]Thank you, i did not notice that, i altered the layout of the script and somehow removed the script that defined the GoUrl() .thank you so much, this has been driving me crazy!! Quote Link to comment https://forums.phpfreaks.com/topic/16053-need-help-with-a-php-error/#findComment-66134 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.