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
    Regular Coder
    Join Date
    Nov 2007
    Posts
    680
    Thanks
    319
    Thanked 1 Time in 1 Post

    T_constant_encapsed_string

    Error:
    Code:
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/martynba/public_html/portfolio/upload.php on line 118
    PHP:
    Code:
    $image_name=$date'.'$imageTitle'.'$extension;
    I don't understand

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Quote Originally Posted by martynball View Post
    Error:
    Code:
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/martynba/public_html/portfolio/upload.php on line 118
    PHP:
    Code:
    $image_name=$date'.'$imageTitle'.'$extension;
    I don't understand
    You have your text right up against your variables with no period to attach them. Try this instead:
    PHP Code:
    $image_name=$date.'.'.$imageTitle.'.'.$extension
    Unless you don't want to add periods between the variables. In that case you would use this:
    PHP Code:
    $image_name=$date.$imageTitle.$extension
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • Users who have thanked Rowsdower! for this post:

    martynball (01-14-2010)

  • #3
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    PHP Code:
    $image_name=$date.$imageTitle.$extension
    You had quotes around places they werent meant to be
    If you look at your code hilighted you can see the problem area
    PHP Code:
    $image_name=$date'.'$imageTitle'.'$extension
    . If you meant for those dots to be actual dots and not to concatenate the strings then you need to have dots around them too. For example this
    PHP Code:
    $image_name=$date.'.'.$imageTitle.'.'.$extension
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #4
    Regular Coder
    Join Date
    Nov 2007
    Posts
    680
    Thanks
    319
    Thanked 1 Time in 1 Post
    That worked, cheers


  •  

    Posting Permissions

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