Parse error: parse error, unexpected T_STRING in /home/content/d/r/a/dragun/html/vote

Thread Solved

Join Date: Oct 2007
Posts: 34
Reputation: dragon@dragon64 is an unknown quantity at this point 
Solved Threads: 0
dragon@dragon64 dragon@dragon64 is offline Offline
Light Poster

Parse error: parse error, unexpected T_STRING in /home/content/d/r/a/dragun/html/vote

 
0
  #1
Nov 19th, 2008
Hi

i have made a stupid mistake in my code which i cannot find,and i am getting this error
Parse error: parse error, unexpected T_STRING in /home/content/d/r/a/dragun/html/vote.php on line 107

According to my eye sight it should be o.k. but apparently not. Can anyone give a helping hand. As far as i know all by curly brackets and semi colons are in place.

line 107 is nearly at the end and i wrote the line number text to it so one could know which line it is

thank you


  1. <?php
  2.  
  3. // Connects to your Database
  4.  
  5.  
  6. mysql_connect("p50mysql293.secureserver.net", "dragonfire1", "Panther1") or die(mysql_error());
  7. mysql_select_db("dragonfire1") or die(mysql_error());
  8.  
  9.  
  10.  
  11.  
  12. //Name of our cookie
  13. //$cookie = "Voted";
  14.  
  15. //A function to display our results - this refrences vote_pie.php which we will also make
  16. function pie ()
  17. {
  18. $data = mysql_query("SELECT * FROM votes")
  19. or die(mysql_error());
  20. $result = mysql_fetch_array( $data );
  21. $total = $result[first] + $result[sec] + $result[third] + $result[forth] +$result[fifth] + $result[sixth] + $result[seventh] + $result[eighth] + $result[ninth] + $result[tenth] + $result[eleventh];
  22. $one = round (360 * $result[first] / $total);
  23. $two = round (360 * $result[sec] / $total);
  24. $three = round (360 * $result[third] / $total);
  25. $four = round (360 * $result[fourth] / $total);
  26. $five = round (360 * $result[fifth] / $total);
  27. $six = round (360 * $result[six] / $total);
  28. $seven = round (360 * $result[seventh] / $total);
  29. $eight = round (360 * $result[eighth] / $total);
  30. $nine = round (360 * $result[ninth] / $total);
  31. $ten = round (360 * $result[tenth] / $total);
  32. $per1 = round ($result[first] / $total * 100);
  33. $per2 = round ($result[sec] / $total * 100);
  34. $per3 = round ($result[third] / $total * 100);
  35. $per4 = round ($result[forth] / $total * 100);
  36. $per5 = round ($result[fifth] / $total * 100);
  37. $per6 = round ($result[sixth] / $total * 100);
  38. $per7 = round ($result[seventh] / $total * 100);
  39. $per8 = round ($result[eighth] / $total * 100);
  40. $per9 = round ($result[ninth] / $total * 100);
  41. $per10 = round ($result[tenth] / $total * 100);
  42. $per11 = round ($result[eleventh] / $total * 100);
  43. echo "<img src=vote_pie.php?one=".$one."&two=".$two."&three=".$three."four=".$four."&five=".$five."&six=".$six."&seven".$seven."&eight".$eight."&nine".$nine."&ten=".$ten."><br>";
  44. Echo "<font color=ff0000>Results Page</font> = $result[first] vote, $per1 %<br>
  45. <font color=0000ff>Circulars Page </font> = $result[sec] vote, $per2 %<br>
  46. <font color=00ff00>Training Schedule Page </font> = $result[third] vote, $per3 %<br>
  47. <font color=00ff00>Front Page </font> = $result[forth] vote, $per4 %<br>
  48. <font color=00ff00>Events/News</font> = $result[fifth] vote, $per5 %<br>
  49. <font color=00ff00>Shop</font> = $result[sixth] vote, $per6 %<br>
  50. <font color=00ff00>Trips Abroad</font> = $result[seventh] vote, $per7 %<br>
  51. <font color=00ff00>Links </font> = $result[eighth] vote, $per8 %<br>
  52. <font color=00ff00>Games </font> = $result[ninth] vote, $per9 %<br>
  53. <font color=00ff00>Football Club</font> = $result[tenth] vote, $per10 %<br>
  54. <font color=00ff00>Sports Club</font> = $result[eleventh] vote, $per11 %<br>";
  55. }
  56.  
  57. //This runs if it is in voted mode
  58. if ( $mode=="voted")
  59. {
  60.  
  61. //makes sure they haven't already voted
  62. if(isset($_COOKIE[$cookie]))
  63. {
  64. Echo "Sorry You have already voted this month<br>";
  65. }
  66.  
  67. //sets a cookie
  68. else
  69. {
  70. $month = 2592000 + time();
  71. setcookie(Voted, Voted, $month);
  72.  
  73. // adds their vote to the database
  74. switch ($vote)
  75. {
  76. case 1:
  77. mysql_query ("UPDATE votes SET first = first+1");
  78. break;
  79. case 2:
  80. mysql_query ("UPDATE votes SET sec = sec+1");
  81. break;
  82. case 3:
  83. mysql_query ("UPDATE votes SET third = third+1");
  84. break;
  85. case 4:
  86. mysql_query ("UPDATE votes SET forth = forth+1");
  87. break;
  88. case 5:
  89. mysql_query ("UPDATE votes SET fifth = fifth+1");
  90. break;
  91. case 6:
  92. mysql_query ("UPDATE votes SET sixth = sixth+1");
  93. break;
  94. case 7:
  95. mysql_query ("UPDATE votes SET seventh = seventh+1");
  96. break;
  97. case 8:
  98. mysql_query ("UPDATE votes SET eighth = eighth+1");
  99. break;
  100. case 9:
  101. mysql_query ("UPDATE votes SET ninth = ninth+1");
  102. break;
  103. case 10:
  104. mysql_query ("UPDATE votes SET tenth = tenth+1");
  105. break;
  106. case 11
  107. [B]mysql_query ("UPDATE votes SET eleventh = eleventh+1"); line 107[/B]}
  108.  
  109. //displays the poll results
  110. pie ();
  111. }
  112. }
Last edited by peter_budo; Nov 20th, 2008 at 12:58 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 232
Reputation: Rhyan is an unknown quantity at this point 
Solved Threads: 24
Rhyan's Avatar
Rhyan Rhyan is offline Offline
Posting Whiz in Training

Re: Parse error: parse error, unexpected T_STRING in /home/content/d/r/a/dragun/html/

 
1
  #2
Nov 19th, 2008
You have omitted column ( : ) on case 11, and the break statement after it.
" Of all the things I've lost,
I miss my mind the most...."
Mark Twain
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 34
Reputation: dragon@dragon64 is an unknown quantity at this point 
Solved Threads: 0
dragon@dragon64 dragon@dragon64 is offline Offline
Light Poster

Re: Parse error: parse error, unexpected T_STRING in /home/content/d/r/a/dragun/html/vote

 
0
  #3
Nov 19th, 2008
Thank you just the same i managed to find my mistake,
I forgot to type the colon after the case 11 in line 106
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 34
Reputation: dragon@dragon64 is an unknown quantity at this point 
Solved Threads: 0
dragon@dragon64 dragon@dragon64 is offline Offline
Light Poster

Re: Parse error: parse error, unexpected T_STRING in /home/content/d/r/a/dragun/html/

 
0
  #4
Nov 19th, 2008
Originally Posted by Rhyan View Post
You have omitted column ( : ) on case 11, and the break statement after it.
Thank you
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC