This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 7 years ago.
I have a PHP script that basically tries to convert the string it gets from:
https://camwijs.nl/system/avatarimage.aspx?username=
to
https://www.habbo.com/habbo-imaging/avatarimage?figure=
If I run the code it just gives me an page with the error message:
Warning: file_get_contents(https//camwijs.nl/system/avatarimage.aspx?username=nomakta): failed to open stream: No such file or directory in /home/u750368594/public_html/v1/avatar/avatar.php on line 4
http://www.habbo.com/habbo-imaging/avatarimage?figure=
Here is the code:
<?php
// gets avatar with GR
$camwijsAvatarurl = "https//camwijs.nl/system/avatarimage.aspx?username=".htmlspecialchars($_GET["name"]);
// displays avatar link here
echo 'http://www.habbo.com/habbo-imaging/avatarimage?fgure=' .file_get_contents($camwijsAvatarurl);
?>
You have an extra trailing . at the end of line 2, which throws a syntax error for improper concatenation:
Parse error: syntax error, unexpected ';' in ... on line 2
Either remove that . or add " " (but only if you're planning on concatenating further)
Related
This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 5 years ago.
I place to the php line a large piece of html code with javascript inserts (with jQuery) in which $ symbols is present.
<?php
$site = <<<SITE_CODE
setTimeout(function(){$(g_utils._f().menu.current_id).trigger('click')}, g_utils.effects.animation(g_utils._f().animation.events.loading, 'delay2'));
SITE_CODE;
echo $site;
?>
PHP takes this as a variable and produces an error.
Parse error: syntax error, unexpected '(', expecting T_VARIABLE or '$'
in D:\site\index.php on line 328
Tell me how to get rid of this problem?
If you single quote the EOL string it will not evaluate any variable:
$site =
<<<'SITE_CODE'
setTimeout(function(){$(g_utils._f().menu.current_id).trigger('click')}, g_utils.effects.animation(g_utils._f().animation.events.loading, 'delay2'));
SITE_CODE;
This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 5 years ago.
I am receiving this error message:
[17-Mar-2017 10:22:14 America/Detroit] PHP Parse error: syntax error, unexpected end of file in /home/smarthea/public_html/ocart/vqmod/vqcache/vq2-catalog_controller_common_header.php on line 50
Here is the end of my code in the vqcache PHP file:
$this->template = 'default/template/common/header.tpl'; }
{ $this->render(); }
?>
Which syntax am I missing?
See you modification-file. You just missed line number. Just look into instructions in modificator and correct it.
This error usually appear when you're using several vQmod mofificators that used same file. In you case they modify /catalog/controller/common/header.php
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 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 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