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 Coder
    Join Date
    Oct 2006
    Posts
    71
    Thanks
    3
    Thanked 0 Times in 0 Posts

    php gdimage upload to server

    auto upload

    It's my old thread and i'm not sure if i want to revive it.

    I tried doing the same code using heredoc and I'm getting an error.

    I use

    PHP Code:
    $xxx10
    $filename "./images/saved/"
    for(
    $i 0$i $xxx$i++) 

        
    $char chr(mt_rand(9797 25)); //Make a random lower case letter 
        
    $filename .= $char

    $filename .= '.gif'
    and when i use the above code,i get a blank screen. Now, when I change

    PHP Code:
    imagepng($im$filename); 
    I get a blank screen. I add the heredoc and I will get an error.

    PHP Code:
    echo <<<QQQ
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
    <html> 
    <head> 
    <title>Banner created!</title> 
    </head> 
    <body> 
    <h1>Banner has been created!</h1> 
    Here is the banner: 
    <br> 
    <img src="$filename"> 
    </body> 
    </html> 
    QQQ; 

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Quote Originally Posted by van21691 View Post
    I tried doing the same code using heredoc and I'm getting an error.
    Which is...?

  • #3
    New Coder
    Join Date
    Oct 2006
    Posts
    71
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Inigoesdr View Post
    Which is...?
    When inserting the code to upload the generated gdimage to my server, it's not working now.

    Everytime I insert the code, it's either I'm getting a blank screen or
    PHP Code:
    PHP Parse error:  syntax errorunexpected $end 
    I'm not sure how I did that before.

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Unexpected $end generally means you are missing a closing brace "}" to one of your blocks.


  •  

    Posting Permissions

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