DarkPrince2005 Posted July 24, 2008 Share Posted July 24, 2008 Can someone please help me, i can't seem to find the syntax errors on line 91 and 104, i've been fidling and trying to solve it all day. <?php if (!session_id()) { session_start(); }//connect to the database $connect = mysql_connect("localhost", "root", "") or die ("Hey loser, check your server connection."); mysql_select_db("pc_lan_it") or die (mysql_error()); $sessid = session_id(); //display number of products in cart $query = "select tbl_cart.product_id as 'id', sum(tbl_cart.cart_qty) as 'a', tbl_cart.cart_qty, tbl_cart.cart_session_id, tbl_cart.cart_id, tbl_product.product_name as 'name',tbl_product.product_price as 'price' from tbl_cart,tbl_product where cart_session_id like '$sessid' and tbl_product.product_id = tbl_cart.product_id group by tbl_cart.product_id"; //$query = "select tbl_cart.product_id, sum(tbl_cart.cart_qty), tbl_cart.cart_session_id,tbl_cart.cart_id, tbl_product.* from tbl_cart,tbl_product group by product_id where tbl_cart.cart_session_id like '$sessid' and tbl_cart.product_id = tbl_product.product_id"; $results = mysql_query($query); //$rows = mysql_num_rows($results); echo $rows; echo "<html> <head> <title>Pc,LAN & IT Consulting Web Template</title> <style> h1{font-size:'13pt'; } .scrollable { width: 650px; height: 95%; overflow: auto; background-repeat:no-repeat; } </style>"; //echo "<SCRIPT TYPE='text/javascript' SRC='js/backlink.js'></SCRIPT>"; echo " </head> <body topmargin='0' bottommargin='0' leftmargin='0' rightmargin='0' bgcolor='#E4E5E7'> <center><table cellpadding='0' border='0' cellspacing='0' height='100%'> <tr> <td colspan='2' height='110' width='893' background='images/top4.gif' align='right' valign='top'> <form name='myform1' action='' method='post'> <table height='84' cellpadding='0' cellpadding='0' border='0'> <tr> <td height='36' valign='top' align='right'> <a href='index.php'><img src='images/home.gif' border='0' class='domroll images/home1.gif' alt='Home'></a> <a href='contact.html'><img src='images/contact.gif' border='0' class='domroll images/contact1.gif' alt='Contact Us'></a> <a href='newsletter.html'><img src='images/news.gif' border='0' class='domroll images/news1.gif' alt='Newsletter'></a> <a href='login.html'><img src='images/login.gif' border='0' class='domroll images/login1.gif' alt='Login'></a> <a href='order.html'><img src='images/order.gif' border='0' class='domroll images/order1.gif' alt='Order'></a> <a href='cart.php'><img src='images/cart.gif' border='0' class='domroll images/cart1.gif' alt='Shopping Cart'></a> </td> </tr> <tr> <td valign='center' align='right'><input type='text' size='15' name='search'> <a href='javascript:document.myform1.submit()' onmouseover='document.myform1.sub_but.src='images/search11.gif'' onmouseout='document.myform1.sub_but.src='images/search1.gif''><img src='images/search1.gif' border='0' name='sub_but' alt='Search'></a> </td> </tr> </table></form> </td> </tr> <tr> <td width='192' height='408' background='images/categories_nav.gif' valign='top'><center><font size='1'><br><br><br></font> <a href='notebooks.html'><img src='images/notebooks.gif' height='36' border='0' class='domroll images/notebooks1.gif' alt='Notebooks'></a><br> <a href='desktops.html'><img src='images/desktops.gif' height='36' border='0' class='domroll images/desktops1.gif' alt='Desktops'></a><br> <a href='hardware.html'><img src='images/hardware.gif' height='36' border='0' class='domroll images/hardware1.gif' alt='Hardware'></a><br> <a href='software.html'><img src='images/software.gif' height='36' border='0' class='domroll images/software1.gif' alt='Software'></a><br> <a href='accessories.html'><img src='images/accessories.gif' height='36' border='0' class='domroll images/accessories1.gif' alt='Accessories'></a><br> <a href='handhelds.html'><img src='images/handhelds.gif' height='36' border='0' class='domroll images/handhelds1.gif' alt='Handhelds'></a><br> <a href='plasmas.html'><img src='images/plasmas.gif' height='36' border='0' class='domroll images/plasmas1.gif' alt='Plasmas'></a><br> <a href='projectors.html'><img src='images/projectors.gif' height='36' border='0' class='domroll images/projectors1.gif' alt='Projectors'></a><br> <a href='hometheatersystems.html'><img src='images/homet.gif' height='36' border='0' class='domroll images/homet1.gif' alt='Home Theater Systems'></a><br> <a href='printersandscanners.html'><img src='images/printers.gif' height='36' border='0' class='domroll images/printers1.gif' alt='Printers & Scanners'></a><br></td> <td rowspan='2' width='701' valign='top' align='left' background='images/body.gif'><div class='scrollable'> <table border='0' cellpadding='0' cellspacing='0' width='650' height='100%'><tr><td align='center' valign='top'><br><br> <center><table border='0' width='625' align='center' cellpadding='5'> <tr> <td>Quantity</td> <td>Item Image</td> <td>Item Name</td> <td>Price Each</td> <td>Extended Price</td> <td></td> <td></td>"; //$total = 0; while ($row = mysql_fetch_array($results)) { echo "<tr> <td> <form method='POST' action=''> <input type='hidden' name='modified_hidden' value='$row[cart_id]'> <input type='text' name='modified_quan' size='2' value='$row[a]'> </td> <td>$row[id]</td> <td>$row[name]</td> <td align='right'>$row[price]</td> <td align='right'>"; //get extended price $extprice = number_format($row['price'] * $row['a'], 2); echo $extprice; echo "</td> <td><input type='submit' name='change' value=\"Change Qty\" onclick=\"this.form.action='modcart.php?action=change';\"><br> <input type='submit' name='delete' value=\"Delete Item\" onclick=\"this.form.action='modcart.php?action=delete';\"> </form></td>"; echo "</tr>"; //add extended price to total //$total = mysql_query("select sum(product_price) from tbl_cart where cart_session_id like '$sessid'"); } ?> <tr> <td colspan="4" align="right"> Your total before shipping is:</td> <td align="right"> <?php echo number_format($total, 2); ?></td> <td></td> <td> <?php echo "<form method=\"POST\" action=\"modcart.php?action=empty\"> <input type=\"hidden\" name=\"carttemp_hidden\" value=\""; if (isset($carttemp_hidden)) { echo $carttemp_hidden; } echo "\">"; echo "<input type=\"submit\" name=\"Submit\" value=\"Empty Cart\"> </form>"; ?> </td> </tr> </table> <form method="POST" action="checkout.php"> <input type="submit" name="Submit" value="Proceed to Checkout"> </form> <SCRIPT TYPE="text/javascript"> <!-- var bl = new backlink(); bl.write(); //--> </SCRIPT> <?php echo "</td></tr></table></div> </td> </tr> <tr> <td background='images/search.gif' valign='top' align='center'><center><font size='1'><br><br><br></font> <form name='myform' action='' method='post'> <table cellpadding='0' cellspacing='0' border='0' width='160'> <tr> <td valign='center'><input type='text' size='15' name='search'> <a href='javascript:document.myform.submit()' onmouseover='document.myform.sub_but.src='images/search11.gif'' onmouseout='document.myform.sub_but.src='images/search1.gif''><img src='images/search1.gif' border='0' name='sub_but' alt='Search'></a></td> </tr> </table> </form> </td> </tr> <tr> <td colspan='2' height='24' background='images/bottom.gif'></td> </tr> </table> <script src='js/chrisdomroll.js'> </script>"; ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/116450-solved-spot-the-error/ Share on other sites More sharing options...
.josh Posted July 24, 2008 Share Posted July 24, 2008 Marking the lines and posting the error message usually helps in getting a faster response. Quote Link to comment https://forums.phpfreaks.com/topic/116450-solved-spot-the-error/#findComment-598832 Share on other sites More sharing options...
revraz Posted July 24, 2008 Share Posted July 24, 2008 I thought it was some kind of riddle and we would get a prize if we found it. Quote Link to comment https://forums.phpfreaks.com/topic/116450-solved-spot-the-error/#findComment-598840 Share on other sites More sharing options...
DarkPrince2005 Posted August 5, 2008 Author Share Posted August 5, 2008 The problem was with the way i was echoing the javascript Quote Link to comment https://forums.phpfreaks.com/topic/116450-solved-spot-the-error/#findComment-609063 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.