This question already has answers here:
unexpected $end [closed]
(2 answers)
Closed 9 years ago.
hello i have this error
Parse error: syntax error, unexpected $end in /var/www/vhosts/mywebsite.com/httpdocs/project/templates/yoo_balance/layouts/com_content/article/default.php on line 191
here is the code : http://paste2.org/hMZ6z0dF
Thank you for your help.
Problem is on 143rd line,.
You are closing php 2 times
143rd line and
180th line
so just remove ?> from 143rd line
on line 132 you are closing the php code with '?>'. And then you continue without opening another '<?php' .remove that line.
?>
if (isset($images->image_fulltext) and !empty($images->image_fulltext)) {
and because you have MANY unnecessary opening and closings of php sections, you must have many more similar errors...
Related
This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 2 years ago.
I'm receiving the following error on my wordpress site:
An error of type E_PARSE was caused in line 56 of the file /var/www/compass.valuescentre.com/wp-content/plugins/woocommerce/woocommerce.php. Error message: syntax error, unexpected ':', expecting '{'
Below is my code from line 56-58:
function wc_get_container() : \Psr\Container\ContainerInterface { return $GLOBALS['wc_container']; }
A compiler gets problems on the exact location of a missing ),},; or ].
I would advice you to look if you missed any closing tags in the lines before 56.
if you whant to make that fast, maybe go with control + f to look for the amount of opening brakets and see if it matches the closing ones?
good luck!
This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 4 years ago.
I got Error like this [Parse error: syntax error, unexpected 'connected' (T_STRING) in C:\xampp\htdocs\koneksi\update.php on line 5]
<?php
if($_SERVER['REQUEST_METHODE']=='POST){
include('connected.php');
$room=$_POST['NoRoom'];
$status=$_POST['RoomStatus'];
$Sql_Query="UPDATE cfg_init_room SET number='$room, status_code='$status';
if (mysqli_query($con,$SQl_Query));
{
echo 'Status Updated';
}else{
echo'Gagal Update Status';
}
}mysqli_close($con);
?>
On this line if($_SERVER['REQUEST_METHODE']=='POST){ there is a missing ' after POST.
Make that line if($_SERVER['REQUEST_METHODE']=='POST'){ and it should work.
On most IDEs you will see a shift in text color between strings and functions, just like here on SO.
That is a telling sign you forgot to close a string.
Edit: now that I look at your code more closely it seems you have another string problem.
At the end in the if else your strings are correct. They shouldn't.
So that means there is another problem with your strings, probably in $sql_query line.
This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 5 years ago.
last "}" is line 762. log says "PHP Parse error: syntax error, unexpected '}' in /home/u230748479/public_html/application/controllers/api_new.php on line 762" if you need whole code ill send you. please help me. thanks.
https://drive.google.com/open?id=0B6DjyTFNtfv5SjZBM2JGNVh2V2c
link to my php file
There is nothing wrong with your code, but you got 3 invalid (\u007F) characters before the } that gives the error.
This is your code
echo "1";
}
// this line contains 3 invalid characters (\u007F = DELETE character)
} // this is line 762
Remove the line with the invalid characters and you should be good to go.
This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 7 years ago.
I am trying to fopen() a debugging text file, which I have simply named debug.txt and put it on my desktop. I am using PHP. My code is simply
$debug_file = fopen( "C:\\Users\\joe\\Desktop\\debug.txt", "w" );
I keep getting this error
Parse error: syntax error, unexpected '$debug_file' (T_VARIABLE) ` on line 755, which is the line of code above.
I have checked the code before this line for a missing semicolon, as that often is the source of a syntax error, but the previous code is fine. If I comment out my one line of code, the PHP file no longer gives a syntax error.
I was thinking that there is something wrong with the way I write the string literal file path to open. I have tried to make it ok by escaping the backslashes. I'm using Windows 10. But that hasn't fixed the problem. For the life of me I can't figure out what the syntax error is.
Thanks for any help.
EDIT: As requested, the previous lines of code are:
add_shortcode('hide-it', 'hide_it_func');
function hide_it_func(){
return;
}
The problem is the line(s) above, you either didn't end it with a semicolon or there's an open bracket, or something along those lines.
This question already has answers here:
How to fix syntax error, unexpected T_IF error in php? [closed]
(3 answers)
Closed 9 years ago.
Parse error: syntax error, unexpected T_IF in /home3/mathiasf/public_html/wp-content/themes/smartstart/functions/plugin-activation.php on line 991
this is what i found in line 991
if ( ! class_exists( 'WP_List_Table' ) ) {
How can I solve this error?
Here is the full code: http://pastebin.com/UB0EWK2A
You probably forgot a ; on the previous line, e.g.
echo 'foo'
if (...) { ... }
would trigger the error.