legohead6 Posted October 7, 2006 Share Posted October 7, 2006 unexpected $ sign on line 60(line 60: "?>")even after adding a thired close brace to the end the same error is appearingthis page is a final form to order an item![code]<?phpSESSION_START();if(empty($_SESSION['user'])){echo "You have come to this page by mistake! Please <a href=http://www.zelocalz.com>Click here</a>";exit;}include 'header.php';$username="***********";$password="***********";$database="************";mysql_connect(localhost,$username,$password);@mysql_select_db($database) or die( "Unable to select database");if($_GET['me'] == 0){$form1="<p align=center>How Would You Like To Pay?<br><form method=POST><b><input type=radio name=method value=Paypal>Paypal <a href=help/paypal.php>Whats this?</a><br><br><input type=radio name=method value=Cash>Cash In The Mail</b><br><input type=submit name=submit3 value=GO></form>";}if(isset($_POST['submit3'])){$lid=$_GET['id'];$lis="SELECT * FROM listings WHERE id='$lid'";$result3 = mysql_query($lis) or die ("Error in query: $quer3. ".mysql_error());while($row = mysql_fetch_row($result3)){$form1="<a href=home.php>Return Home</a><br>Thank You!<br><a href=invoice.php?id=$lid>View INVOICE</a><br>";$method=$_POST['method'];$pick1=0;$ship1=1;$lid=$_GET['id'];$user=$_SESSION['user'];$query2="INSERT INTO purchased VALUES('','$user','$lid','$ship1','$pick1','$method','$row[5]')";$result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error());$mem="SELECT * FROM members WHERE username='$row[5]'";$result5 = mysql_query($mem) or die ("Error in query: $mem. ".mysql_error());while($mem = mysql_fetch_row($result5)){mail($mem[3],'Item Sold',"Congratulations!, Youve Sold $row[1] To $user! Go To http://www.zelocalz.com To view Invoice!","From:zelocalz<[email protected]>");}}if($_GET['me'] == 1){$form1="";echo "Thankyou! <br><a href=invoice.php?id=$lid>View INVOICE</a><br>";$pick1=1;$ship1=0;$pay=0;$cash=0;$lid=$_GET['id'];$lis="SELECT * FROM listings WHERE id='$lid'";$result3 = mysql_query($lis) or die ("Error in query: $query3. ".mysql_error());while($row = mysql_fetch_row($result3)){$user=$_SESSION['user'];$query2="INSERT INTO purchased VALUES('','$user','$lid','$ship1','$pick1','0','$row[5]')";$result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error());$uplist="UPDATE listings SET sold='1' WHERE id='$lid'";mysql_query($uplist) or die ("Error in query: $uplist. ".mysql_error());$mem="SELECT * FROM members WHERE username='$row[5]'";$result5 = mysql_query($mem) or die ("Error in query: $mem. ".mysql_error());while($mem = mysql_fetch_row($result5)){mail($mem[3],'Item Sold',"Congratulations!, Youve Sold $row[1] To $user! Go To http://www.zelocalz.com To view Invoice!","From:zelocalz<[email protected]>");}}}echo "$form1";?>[/code] Link to comment https://forums.phpfreaks.com/topic/23286-solved-help-parse-error-driving-me-nuts/ Share on other sites More sharing options...
redarrow Posted October 7, 2006 Share Posted October 7, 2006 } add another brace } to the bottom ok it's missing?[code]<?php session_start();if(empty($_SESSION['user'])){ //<< brace openecho "You have come to this page by mistake! Please <a href=http://www.zelocalz.com>Click here</a>";exit;}//<< brace closedinclude 'header.php';$username="***********";$password="***********";$database="************";mysql_connect(localhost,$username,$password);@mysql_select_db($database) or die( "Unable to select database");if($_GET['me'] == 0){// brace oped$form1="<p align=center>How Would You Like To Pay?<br><form method=POST><b><input type=radio name=method value=Paypal>Paypal <a href=help/paypal.php>Whats this?</a><br><br><input type=radio name=method value=Cash>Cash In The Mail</b><br><input type=submit name=submit3 value=GO></form>";}//<< brace closedif(isset($_POST['submit3'])){ //<< brace open$lid=$_GET['id'];$lis="SELECT * FROM listings WHERE id='$lid'";$result3 = mysql_query($lis) or die ("Error in query: $quer3. ".mysql_error());while($row = mysql_fetch_row($result3)){//<< brace open$form1="<a href=home.php>Return Home</a><br>Thank You!<br><a href=invoice.php?id=$lid>View INVOICE</a><br>";$method=$_POST['method'];$pick1=0;$ship1=1;$lid=$_GET['id'];$user=$_SESSION['user'];$query2="INSERT INTO purchased VALUES('','$user','$lid','$ship1','$pick1','$method','$row[5]')";$result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error());$mem="SELECT * FROM members WHERE username='$row[5]'";$result5 = mysql_query($mem) or die ("Error in query: $mem. ".mysql_error());while($mem = mysql_fetch_row($result5)){mail($mem[3],'Item Sold',"Congratulations!, Youve Sold $row[1] To $user! Go To http://www.zelocalz.com To view Invoice!","From:zelocalz<[email protected]>");} //<< brace closed}//<< brace closedif($_GET['me'] == 1){//<<brace open$form1="";echo "Thankyou! <br><a href=invoice.php?id=$lid>View INVOICE</a><br>";$pick1=1;$ship1=0;$pay=0;$cash=0;$lid=$_GET['id'];$lis="SELECT * FROM listings WHERE id='$lid'";$result3 = mysql_query($lis) or die ("Error in query: $query3. ".mysql_error());while($row = mysql_fetch_row($result3)){//<< brace open$user=$_SESSION['user'];$query2="INSERT INTO purchased VALUES('','$user','$lid','$ship1','$pick1','0','$row[5]')";$result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error());$uplist="UPDATE listings SET sold='1' WHERE id='$lid'";mysql_query($uplist) or die ("Error in query: $uplist. ".mysql_error());$mem="SELECT * FROM members WHERE username='$row[5]'";$result5 = mysql_query($mem) or die ("Error in query: $mem. ".mysql_error());while($mem = mysql_fetch_row($result5)){//<<brace openmail($mem[3],'Item Sold',"Congratulations!, Youve Sold $row[1] To $user! Go To http://www.zelocalz.com To view Invoice!","From:zelocalz<[email protected]>");}//<<brace closed}//<<brace closed}//<<brace now closed but wasnt there 1 min ago.echo "$form1";?>[/code] Link to comment https://forums.phpfreaks.com/topic/23286-solved-help-parse-error-driving-me-nuts/#findComment-105559 Share on other sites More sharing options...
kenrbnsn Posted October 7, 2006 Share Posted October 7, 2006 An error like that is usually caused by mis-matched curly braces or an unterminated string.Please edit your above post to:[list][*]Change the case of your opening "<?PHP" to "<?php"[*]Indent your code correctly, which will make unbalanced curly braces much easier to find.[/list]Ken Link to comment https://forums.phpfreaks.com/topic/23286-solved-help-parse-error-driving-me-nuts/#findComment-105562 Share on other sites More sharing options...
legohead6 Posted October 7, 2006 Author Share Posted October 7, 2006 its not a curly brace prob i have tryed adding then on at the end and it still shows the error just another line down.. Link to comment https://forums.phpfreaks.com/topic/23286-solved-help-parse-error-driving-me-nuts/#findComment-105563 Share on other sites More sharing options...
alpine Posted October 7, 2006 Share Posted October 7, 2006 I found two missing curly brackets, see comments in code[code]<?phpSESSION_START();if(empty($_SESSION['user'])){echo "You have come to this page by mistake! Please <a href=http://www.zelocalz.com>Click here</a>";exit;}include 'header.php';$username="***********";$password="***********";$database="************";mysql_connect(localhost,$username,$password);@mysql_select_db($database) or die( "Unable to select database");if($_GET['me'] == 0){$form1="<p align=center>How Would You Like To Pay?<br><form method=POST><b><input type=radio name=method value=Paypal>Paypal <a href=help/paypal.php>Whats this?</a><br><br><input type=radio name=method value=Cash>Cash In The Mail</b><br><input type=submit name=submit3 value=GO></form>";}if(isset($_POST['submit3'])){$lid=$_GET['id'];$lis="SELECT * FROM listings WHERE id='$lid'";$result3 = mysql_query($lis) or die ("Error in query: $quer3. ".mysql_error());while($row = mysql_fetch_row($result3)){$form1="<a href=home.php>Return Home</a><br>Thank You!<br><a href=invoice.php?id=$lid>View INVOICE</a><br>";$method=$_POST['method'];$pick1=0;$ship1=1;$lid=$_GET['id'];$user=$_SESSION['user'];$query2="INSERT INTO purchased VALUES('','$user','$lid','$ship1','$pick1','$method','$row[5]')";$result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error());$mem="SELECT * FROM members WHERE username='$row[5]'";$result5 = mysql_query($mem) or die ("Error in query: $mem. ".mysql_error());while($mem = mysql_fetch_row($result5)){mail($mem[3],'Item Sold',"Congratulations!, Youve Sold $row[1] To $user! Go To http://www.zelocalz.com To view Invoice!","From:zelocalz<[email protected]>");}}} // <-----######################## } WAS MISSING #############################if($_GET['me'] == 1){$form1="";echo "Thankyou! <br><a href=invoice.php?id=$lid>View INVOICE</a><br>";$pick1=1;$ship1=0;$pay=0;$cash=0;$lid=$_GET['id'];$lis="SELECT * FROM listings WHERE id='$lid'";$result3 = mysql_query($lis) or die ("Error in query: $query3. ".mysql_error());while($row = mysql_fetch_row($result3)){$user=$_SESSION['user'];$query2="INSERT INTO purchased VALUES('','$user','$lid','$ship1','$pick1','0','$row[5]')";$result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error());$uplist="UPDATE listings SET sold='1' WHERE id='$lid'";mysql_query($uplist) or die ("Error in query: $uplist. ".mysql_error());$mem="SELECT * FROM members WHERE username='$row[5]'";$result5 = mysql_query($mem) or die ("Error in query: $mem. ".mysql_error());while($mem = mysql_fetch_row($result5)){mail($mem[3],'Item Sold',"Congratulations!, Youve Sold $row[1] To $user! Go To http://www.zelocalz.com To view Invoice!","From:zelocalz<[email protected]>");}}} // <-----######################## } WAS MISSING #############################echo "$form1";?>[/code]I would recomend getting a free php editor that will highlight syntax for you - a good and easy one is PHP Editor on http://www.mpsoftware.dk/ (http://www.mpsoftware.dk/downloads.php) Link to comment https://forums.phpfreaks.com/topic/23286-solved-help-parse-error-driving-me-nuts/#findComment-105564 Share on other sites More sharing options...
legohead6 Posted October 7, 2006 Author Share Posted October 7, 2006 IT needed 2 more braces..hmm i wonder how i missed that! Thanks for the help ITS solved know! Link to comment https://forums.phpfreaks.com/topic/23286-solved-help-parse-error-driving-me-nuts/#findComment-105565 Share on other sites More sharing options...
marcus Posted October 7, 2006 Share Posted October 7, 2006 [code]<?phpSESSION_START();if(empty($_SESSION['user'])){ echo "You have come to this page by mistake! Please <a href=http://www.zelocalz.com>Click here</a>"; exit;} include ('header.php'); $username="***********"; $password="***********"; $database="************"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database");if($_GET['me'] == 0){ $form1="<p align=center>How Would You Like To Pay?<br> <form method=POST><b> <input type=radio name=method value=Paypal>Paypal <a href=help/paypal.php>Whats this?</a> <br><br> <input type=radio name=method value=Cash>Cash In The Mail</b> <br> <input type=submit name=submit3 value=GO></form>";}if(isset($_POST['submit3'])){ $lid=$_GET['id']; $lis="SELECT * FROM listings WHERE id='$lid'"; $result3 = mysql_query($lis) or die ("Error in query: $quer3. ".mysql_error()); while($row = mysql_fetch_row($result3)){ $form1="<a href=home.php>Return Home</a> <br>Thank You!<br><a href=invoice.php?id=$lid>View INVOICE</a> <br>"; $method=$_POST['method']; $pick1='0'; $ship1='1'; $lid=$_GET['id']; $user=$_SESSION['user']; $query2="INSERT INTO purchased VALUES('','$user','$lid','$ship1','$pick1','$method','$row[5]')"; $result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error()); $mem="SELECT * FROM members WHERE username='$row[5]'"; $result5 = mysql_query($mem) or die ("Error in query: $mem. ".mysql_error()); while($mem = mysql_fetch_row($result5)){ mail($mem[3],'Item Sold',"Congratulations!, Youve Sold $row[1] To $user! Go To http://www.zelocalz.com To view Invoice!","From:zelocalz<[email protected]>");};};if($_GET['me'] == 1){ $form1=""; echo "Thankyou! <br><a href=invoice.php?id=$lid>View INVOICE</a><br>"; $pick1='0'; $ship1='0'; $pay='0'; $cash='0'; $lid=$_GET['id']; $lis="SELECT * FROM listings WHERE id='$lid'"; $result3 = mysql_query($lis) or die ("Error in query: $query3. ".mysql_error()); while($row = mysql_fetch_row($result3)){ $user=$_SESSION['user']; $query2="INSERT INTO purchased VALUES('','$user','$lid','$ship1','$pick1','0','$row[5]')"; $result2 = mysql_query($query2) or die ("Error in query: $query2. ".mysql_error()); $uplist="UPDATE listings SET sold='1' WHERE id='$lid'"; mysql_query($uplist) or die ("Error in query: $uplist. ".mysql_error()); $mem="SELECT * FROM members WHERE username='$row[5]'"; $result5 = mysql_query($mem) or die ("Error in query: $mem. ".mysql_error()); while($mem = mysql_fetch_row($result5)){ mail($mem[3],'Item Sold',"Congratulations! You have sold $row[1] To $user! Go To http://www.zelocalz.com To view Invoice!","From:zelocalz<[email protected]>"); } } } }echo "$form1";?>[/code]more organized code if you want :P Link to comment https://forums.phpfreaks.com/topic/23286-solved-help-parse-error-driving-me-nuts/#findComment-105566 Share on other sites More sharing options...
redarrow Posted October 7, 2006 Share Posted October 7, 2006 dam i missed that.well spotted. Link to comment https://forums.phpfreaks.com/topic/23286-solved-help-parse-error-driving-me-nuts/#findComment-105567 Share on other sites More sharing options...
legohead6 Posted October 7, 2006 Author Share Posted October 7, 2006 thanks... i need to start organising my code i guess Link to comment https://forums.phpfreaks.com/topic/23286-solved-help-parse-error-driving-me-nuts/#findComment-105640 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.