| | |
Parse error: parse error, unexpected T_STRING in /home/content/d/r/a/dragun/html/vote
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Oct 2007
Posts: 34
Reputation:
Solved Threads: 0
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
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
php Syntax (Toggle Plain Text)
<?php // Connects to your Database mysql_connect("p50mysql293.secureserver.net", "dragonfire1", "Panther1") or die(mysql_error()); mysql_select_db("dragonfire1") or die(mysql_error()); //Name of our cookie //$cookie = "Voted"; //A function to display our results - this refrences vote_pie.php which we will also make function pie () { $data = mysql_query("SELECT * FROM votes") or die(mysql_error()); $result = mysql_fetch_array( $data ); $total = $result[first] + $result[sec] + $result[third] + $result[forth] +$result[fifth] + $result[sixth] + $result[seventh] + $result[eighth] + $result[ninth] + $result[tenth] + $result[eleventh]; $one = round (360 * $result[first] / $total); $two = round (360 * $result[sec] / $total); $three = round (360 * $result[third] / $total); $four = round (360 * $result[fourth] / $total); $five = round (360 * $result[fifth] / $total); $six = round (360 * $result[six] / $total); $seven = round (360 * $result[seventh] / $total); $eight = round (360 * $result[eighth] / $total); $nine = round (360 * $result[ninth] / $total); $ten = round (360 * $result[tenth] / $total); $per1 = round ($result[first] / $total * 100); $per2 = round ($result[sec] / $total * 100); $per3 = round ($result[third] / $total * 100); $per4 = round ($result[forth] / $total * 100); $per5 = round ($result[fifth] / $total * 100); $per6 = round ($result[sixth] / $total * 100); $per7 = round ($result[seventh] / $total * 100); $per8 = round ($result[eighth] / $total * 100); $per9 = round ($result[ninth] / $total * 100); $per10 = round ($result[tenth] / $total * 100); $per11 = round ($result[eleventh] / $total * 100); 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>"; Echo "<font color=ff0000>Results Page</font> = $result[first] vote, $per1 %<br> <font color=0000ff>Circulars Page </font> = $result[sec] vote, $per2 %<br> <font color=00ff00>Training Schedule Page </font> = $result[third] vote, $per3 %<br> <font color=00ff00>Front Page </font> = $result[forth] vote, $per4 %<br> <font color=00ff00>Events/News</font> = $result[fifth] vote, $per5 %<br> <font color=00ff00>Shop</font> = $result[sixth] vote, $per6 %<br> <font color=00ff00>Trips Abroad</font> = $result[seventh] vote, $per7 %<br> <font color=00ff00>Links </font> = $result[eighth] vote, $per8 %<br> <font color=00ff00>Games </font> = $result[ninth] vote, $per9 %<br> <font color=00ff00>Football Club</font> = $result[tenth] vote, $per10 %<br> <font color=00ff00>Sports Club</font> = $result[eleventh] vote, $per11 %<br>"; } //This runs if it is in voted mode if ( $mode=="voted") { //makes sure they haven't already voted if(isset($_COOKIE[$cookie])) { Echo "Sorry You have already voted this month<br>"; } //sets a cookie else { $month = 2592000 + time(); setcookie(Voted, Voted, $month); // adds their vote to the database switch ($vote) { case 1: mysql_query ("UPDATE votes SET first = first+1"); break; case 2: mysql_query ("UPDATE votes SET sec = sec+1"); break; case 3: mysql_query ("UPDATE votes SET third = third+1"); break; case 4: mysql_query ("UPDATE votes SET forth = forth+1"); break; case 5: mysql_query ("UPDATE votes SET fifth = fifth+1"); break; case 6: mysql_query ("UPDATE votes SET sixth = sixth+1"); break; case 7: mysql_query ("UPDATE votes SET seventh = seventh+1"); break; case 8: mysql_query ("UPDATE votes SET eighth = eighth+1"); break; case 9: mysql_query ("UPDATE votes SET ninth = ninth+1"); break; case 10: mysql_query ("UPDATE votes SET tenth = tenth+1"); break; case 11 [B]mysql_query ("UPDATE votes SET eleventh = eleventh+1"); line 107[/B]} //displays the poll results pie (); } }
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.
Re: Parse error: parse error, unexpected T_STRING in /home/content/d/r/a/dragun/html/
1
#2 Nov 19th, 2008
•
•
Join Date: Oct 2007
Posts: 34
Reputation:
Solved Threads: 0
Re: Parse error: parse error, unexpected T_STRING in /home/content/d/r/a/dragun/html/vote
0
#3 Nov 19th, 2008
•
•
Join Date: Oct 2007
Posts: 34
Reputation:
Solved Threads: 0
Re: Parse error: parse error, unexpected T_STRING in /home/content/d/r/a/dragun/html/
0
#4 Nov 19th, 2008
![]() |
Other Threads in the PHP Forum
- Previous Thread: How to give security image
- Next Thread: Calling an object within a class.
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array autosuggest beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email emptydisplayvalue eregi error explodefunction file files folder form forms function functions google hack href htaccess html image include insert integration ip java javasciptvalidation javascript joomla keywords limit link login loop mail matching menu mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search searchbox server sessions sms soap source space sql structure syntax system table tutorial update upload url validation validator variable video web website xml youtube





