Sig Comp Step-by-Step

Step One
Every script starts with a header..this tells the server what type of image we are making. My image for this lesson is a gif so the header and the output will be gif.

//DEFINE CONTENT TYPE Header("Content-type: image/gif");

The first thing we need to do is to "Import" an image into the script.
$im= imagecreatefromGif('');

This is how we output the image.

This will output the image into your FileManager. Remove the double slash to do this. And then change the output image name or number to prevent override.
//Imagegif($im, ('LoungeLiz-1.gif'));

This tells the server that we're finished with the image for now.


Here is the code. Transload/upload the page to your server, copy and change txt to php. View it. You'll see my chosen gif. Now go get your gif or jpg or picture; go into edit and put its URL where mine is. Be careful of punctuation, and just before the URL you'll see ImagecreatefromGif; if yours is a jpg; change it to imagecreatefromJpeg; with the "e". The header and output should also be changed to jpeg where it says gif.

Lounge Code

Page Two

GD BasicsHome