Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

    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 Code:
    <?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.

  • #2
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts
    So that we know exactly what line 25 is, what is the code on the offending line?

    Is it this line:

    PHP Code:
    imagepng ($image'sig.png'); 
    If so then you probably want it this way?

    PHP Code:
    imagepng ($image,'sig.png'); 
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #3
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by rfresh View Post
    So that we know exactly what line 25 is, what is the code on the offending line?

    Is it this line:

    PHP Code:
    imagepng ($image'sig.png'); 
    If so then you probably want it this way?

    PHP Code:
    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

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •