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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2006
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts

    adding text to images

    hi,


    i want to add the text to my images.here is my code but it is adding the text to only first image(horses.jpg) and displaying that image.
    this is my code.i want to add www.abc.com on both images.
    any of your idea will be appreciated.please find where iam wrong.
    PHP Code:
    <?php 
    $arr1
    =array('horses.jpg','leop.jpg');
    for(
    $i=0$i<count($arr1); $i++) 
        {
    $image imagecreatefromjpeg($arr1[$i]); 
    $font_size 12
    $color imagecolorallocate($image205,205,255); 
    $black imagecolorallocate($image0,0,0); 
    ImageTTFText ($image$font_size00110$black"../fonts/ARIALBD.TTF","www.abcd.com"); 
    ImageTTFText ($image$font_size0009$color"../fonts/ARIALBD.TTF","www.abcd.com"); 
    header("Content-type: image/jpeg"); 
    imagejpeg($image); 
    imagedestroy($image); 
    }
    ?>

    thanks
    mrjameer

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    you looking for something like this?
    http://www.codingforums.com/showthread.php?t=72317

  • #3
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,077
    Thanks
    2
    Thanked 320 Times in 312 Posts
    His real problem is how to output multiple images.

    You cannot output multiple images to a browser unless you place each one in an <img src="ImageURL" alt=""> HTML tag.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

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