• BOOKMARK

  • ADD TO FAVORITES

  • REFERENCES


  • MARC

    Mailing list ARChives
    - Search by -
     Subjects
     Authors
     Bodies





    FOLDOC

    Computing Dictionary




  • Text Link Ads






Creating images with GD and PHP

PHP Tutorials.

Creating images with GD and PHP

New postby Ranman on Thu Mar 27, 2008 10:33 pm

# First create a file that will build the image calling it submit.php

<?
if ($str == "Submit!") { $width = 68; $heigth = 20; }
else { $width = 86; $heigth = 20; }
Header("Content-type: image/gif");
$image = ImageCreate($width,$heigth);
$light_blue = ImageColorAllocate($image,0,153,255);
$dark_blue = ImageColorAllocate($image,0,0,255);
imagestring($image,5,4,2,$str,$dark_blue);
ImageGif($image);
ImageDestroy($image);
?>


# Next create a test page calling it test.html

<?
if (!isset($set)) { $str = "Submit!"; }
else { $str = "Continue!"; }
$no_cashe = date("hi");
?>
<FORM ACTION="<? echo $PHP_SELF; ?>">
<INPUT TYPE="hidden" NAME="set" VALUE="1">
<CENTER>
<INPUT TYPE="image"
SRC="submit.php?str=<? echo $str; ?>&<? echo $no_cashe; ?>"
ALT="<? echo $str; ?>">
</CENTER>
</FORM>


# Lastly point your web browser at http://www.your.domain.com/test.html


Demo!--->http://www.linuxguruz.org/tutorials/38Demo.php
User avatar
Ranman
Site Admin
 
Posts: 25
Joined: Thu Mar 27, 2008 12:27 am

Return to PHP Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests

  • MORE RESOURCE


  • Linux

    The Distributions





    Linux

    The Software





    Linux

    The News



  • MARKETING






  • Toll Free
cron