+ Reply to Thread
Results 1 to 3 of 3

Thread: creating image with PHP
      
   

  1. #1
    cosmiclove is offline Sergeant Major
    Join Date
    Oct 2007
    Posts
    90

    Default creating image with PHP

    Hi there,

    Could you please tell me what is wrong with this php code? It is copied from an O'reilly PHP book, but when i place it in my browser, i get an error message on the 7th or 8th lines.
    PHP Code:
    <? 
    header
    ("content-type: image/png");
    $image imagecreate(400,300);
    $gold imagecolorallocate($image25524000);
    $white imagecolorallocate($image255255255);
    $color $white;
    for (
    $i 400$j 300$i 0$i -= 4$j -= 3) {
    if (
    $color = = $white) {
    $color $gold;
    } else {
    $color $white;
    }
    imagefilledrectangle($image400 $i300 $j$i$j$color);
    }
    imagepng($image);
    imagedestroy($image);
    ?>
    Thanks much for your help,

  2. #2
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,061

    Default Re: creating image with PHP

    if ($color = = $white) {

    Remove the white space between the two "=" signs:

    if ($color == $white) {
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  3. #3
    cosmiclove is offline Sergeant Major
    Join Date
    Oct 2007
    Posts
    90

    Default Re: creating image with PHP

    Naval=Genius!
    Me=silly
    Thanks, man!

    Herman

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49