...

View Full Version : Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING



Mathes
06-19-2010, 04:23 AM
Hey guys,

I'm a PHP n00b and I keep on getting this error in my script:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/a4968862/public_html/sigv2/image_output.php on line 25

script:

<?php
/////////////////////////////////////////////////////////////////////
//generating the image
$image = imagecreatefrompng("sig.png");
$font = 'Avant Garde Book BT';

///////dont change this//////////////////
imagealphablending($image,true);
imagesavealpha($image,true);
////////////////////////////////////////
//imagecolorexact(image, red(between 0 and 255), green, blue)
//imagecolorexact($blub,0,0,0) = black font | imagecolorexact($blub,255,255,255) = white font
$colour = imagecolorexact($image,255,255,255);
//imagefttext(image, font size, angle, x-pos(relative to the image in px), y-pos, font color, fontfile, text output)
///////////anime-text output////////////////
imagefttext($image,20,0,250,40,$colour,$font,$titles[0][0]);
imagefttext($image,14,0,310,60,$colour,$font=swatch,$status[0][0]);
imagefttext($image,14,14,222,72,$colour,$font,$dates[0][0]);
////////////////////////////////////////
///////////manga-text output////////////////
imagefttext($image,20,0,258,75,$colour,$font,$titles[0][0]);
imagefttext($image,14,0,290,90,$colour,$font=swatch,$status[0][0]);
imagefttext($image,14,14,222,72,$colour,$font,$dates[0][0]);
////////////////////////////////////////
imagepng ($image'sig.png'); //we want our final image to be in the png format
//imagepng ($image, sig.png) //imagepng (image, save as); uncomment this line if you want to save your output and use a cronjob for automated update - otherwise leave it as it is
//imagedestroy ($image);
//
/////////////////////////////////////////////////////////////////////
?>



Help would be greatly appreciated.

rfresh
06-19-2010, 06:14 AM
So that we know exactly what line 25 is, what is the code on the offending line?

Is it this line:



imagepng ($image'sig.png');


If so then you probably want it this way?



imagepng ($image,'sig.png');

Mathes
06-19-2010, 07:32 AM
So that we know exactly what line 25 is, what is the code on the offending line?

Is it this line:



imagepng ($image'sig.png');


If so then you probably want it this way?



imagepng ($image,'sig.png');


fixed that, but now i get this:

Warning: imagepng() [function.imagepng]: Unable to open 'sig.png' for writing: Permission denied in /home/a4968862/public_html/sigv2/image_output.php on line 25

Fou-Lu
06-19-2010, 08:38 AM
The file isn't writeable, either chown/chgrp it to your apache user, or chmod it to include write for everyone. This can be done through ssh/cp or you can save to a different file, then destroy the original then rename. Apache user will then be the owner.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum