Parse Error Syntax Error Unexpected T_class In On Line 18
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies parse error syntax error unexpected 'class' (t_class) laravel of this site About Us Learn more about Stack Overflow the company
Parse Error Syntax Error Unexpected T_class Expecting T_string Or T_variable Or '$' In Laravel
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges symfony parse error: syntax error, unexpected 'class' (t_class), expecting identifier (t_string) Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a
Parse Error Syntax Error Unexpected 'class' (t_class) Magento
minute: Sign up PHP Parse error: syntax error, unexpected T_CLASS up vote 3 down vote favorite I'm new to PHP, and i'm making a forum. all the files work except one file, add_topic.php. It gives me an error saying: Parse error: syntax error, unexpected T_CLASS in /home/a3885465/public_html/add_topic.php on line 25 I know it is probably on the lines: } else{ echo "ERROR"; $kernel = $app->make(illuminate\contracts\http\kernel::class); } mysql_close(); but the whole code is below just in case. If you have any idea, it would be really appreciated, thanks! The Code for add_topic.php $host=""host""; $username="username"; $password="password"; $db_name ="database_name"; $tbl_name="forum_question";// Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // get data that sent from form $topic= $_POST['topic']; $detail= $_POST['detail']; $name= $_POST['name']; $email= $_POST['email']; $datetime=date("d/m/y h:i:s");//create date time $sql="INSERT INTO $tbl_name(topic, detail, name, email, datetime)VALUES('$topic', '$detail', '$name', '$email', '$datetime')"; $result=mysql_query($sql); if($result){ echo "Successful
"; echo "View your topic"; else{ echo "ERROR"; } mysql_close(); ?> php html mysql share|improve this question edited Jan 25 at 12:27 easy coder 6811727 asked Dec 29 '10 at 10:46 Niall 2,51531636 There is no occurrence of "class" in the code you show. Please show the exact line where the error occurs in, and the three before and after that –Pekka 웃 Dec 29 '10 at 10:49 2 I wanted to make your code more readable until I saw all the mark-up between it. Please remove all this HTML Mark-up and format your code accordingly –DrCol
in PHP Forum View Course » View http://stackoverflow.com/questions/4553401/php-parse-error-syntax-error-unexpected-t-class Exercise 455 points Submitted by Catherine almost 2 years ago passed but "Parse error: syntax error, unexpected T_CLASS on line 11" on the http://www.codecademy.com/forum_questions/547d310b9c4e9df069000cfb screen class Person{ public $isAlive = true; public $firstname; public $lastname; public $age; } $teacher = new Person(); $student = new Person(); echo $teacher->isAlive; > 2 votes permalink problem solved isAlive; ?> 455 points Submitted by Catherine almost 2 years ago
Objects in PHP Forum View Course » View Exercise 922 points Submitted by Jane Cui almost 3 years ago [resolved] syntax error 5/10 Parse error: syntax error, unexpected TCLASS, expecting TFUNCTION Property Panic (2) The code works, but it gets "Parse error: syntax error, unexpected TCLASS, expecting TFUNCTION on line 19" parse error syntax why? firstname=$firstname; $this->lastname=$lastname; $this->age=$age;) }; $teacher = new Person("boring", "12345", 12345); $student = new Person("Jane", "Cui", "24"); echo $student->age; ?> 1 vote permalink Hi Jane, it looks like you closed your __construct method with a ) instead of a } 3683 points Submitted by Judy almost 3 years ago 2 Comments Jane Cui almost 3 years ago thanks. Judy almost 3 years ago You're welcome.