This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 7 years ago.
I am writing a rss feed with php and mysql using PDO to get the info from the data base but am getting the following error:
Parse error: syntax error, unexpected (T_CONSTANT_ENCAPSED_STRING) in /rss/rss.php on line 36
Line 36:
$data .= "<link>"'http://localhost/gmedia/video1.php?g=.$row['g_code'].'"</link>"; // line 36
You do not escape your string right. Read http://jason.pureconcepts.net/2013/05/fixing-php-errors/ for some tips.
Right way:
$data .= "<link>http://localhost/gmedia/video1.php?g=".$row['g_code']."</link>"; // line 36
Related
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 5 years ago.
When i try to run this script :
include('db.php');
$site=file_get_contents("https://example.com");
$baslik='#<title>(.*?)</title>#si';
$içerik='#<div class="post-content">(.*?)</div>#si';
$kategori='#<p class="post-categories"><span>Kategoriler:(.*?)</a></p>#si';
preg_match($baslik,$site,$baslikfonksiyon);
preg_match($icerik,$site,$icerikfonksiyon);
preg_match($kategori,$site,$kategorifonksiyon);
$baslikkullan=$baslikfonksiyon[1];
$icerikkullan=$icerikfonksiyon[1];
$kategorikullan=$kategorifonksiyon[1];
i see this error in error_log file :
[01-Mar-2017 20:39:41 UTC] PHP Parse error: syntax error, unexpected
'preg_match' (T_STRING) in /example/file/path on line 9
Can anyone explain to me why i get this error
Thanks.
I think you have problem with the regex. Try with:
$baslik = '^.*?<\/title>';
This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 6 years ago.
I'm quite new to PHP. I have created an array which I have included however when I need to echo a url which is in my settings array it just gives me the following error:
Parse error: syntax error, unexpected 'templateurl' (T_STRING) in C:\xampp\htdocs\index.php on line 15
Thanks for your help and time in advance.
Try this:
<?php include('hi.php'); echo $settings['templateurl'];?>
You need to include the file first and then you are able to retrieve the data from it.
This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 7 years ago.
I am using twitterauth.php for getting twitter data in codeigniter php.
It gives me error
Parse error: syntax error, unexpected '[' in C:\xampp\htdocs\twitter\application\controllers\twitteroauth.php on line 117
Line 117 is
public function oauth($path, array $parameters = [])
You need PHP 5.4 or over to use square brackets as array. Upgrade PHP or use array().
This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 7 years ago.
I came across the following error, but I fail to see what is wrong:
Parse error: syntax error, unexpected ''aws_account.aws_account_id'' (T_CONSTANT_ENCAPSED_STRING) in C:\xampp\htdocs\laravel\awsconfig\app\controllers\CRUDController.php on line 11
my join statement where the error is being thrown:
$query = DB::table('ec2_instance')->join('aws_account', 'aws_account.id', '=', 'ec2_instance.id')->select('ec2_instance.instance_id', 'ec2_instance.public_dns_name', 'ec2_instance.key_name','ec2_instance.instance_type','ec2_instance.launch_time','aws_account.aws_account_id')->get();
You've got some junk characters there between the last , and ':