PHP Classes

File: header.php

Recommend this page to a friend!
  Classes of Jon Pulice   JPNavClass   header.php   Download  
File: header.php
Role: Auxiliary script
Content type: text/plain
Description: Image Creator For IMAGE Style
Class: JPNavClass
Output a navigation bar with text, images or table
Author: By
Last change:
Date: 18 years ago
Size: 777 bytes
 

Contents

Class file image Download
<?php

//header
Header("Content-Type: image/png");

// initialize a session. //
session_start();

$w = ( $_GET['w'] !== "") ? $_GET['w'] : 200;

// set up image, the first number is the width and the second is the height//
$im = ImageCreate($w, 18);

//creates two variables to store color//
$white = ImageColorAllocate($im, 255, 255, 255);
$blue = ImageColorAllocate($im, 0, 0, 255);
$navy = ImageColorAllocate($im, 0, 0, 158);

$font = "verdanab.ttf";

$string = $_GET['s'];
$c = ( strtolower($_GET['c']) !== "") ? strtolower($_GET['c']) : 'blue';

//fill image with black//
ImageFill($im, 0, 0, $white);

//writes string //
ImageTTFText($im, 12, 0, 2, 15, $$c, $font, $string);

// output to browser//
ImagePNG($im);
ImageDestroy($im);

?>