XTREME-SOURCE
Search:

Go Back   XTREME-SOURCE > TUTORIALS > TUTORIAL ARCHIVE > TUTORIALS: WEB DESIGN
Shoutbox
Loading...


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 06-02-2006, 06:52 AM
kambodianboi's Avatar
Administrator
 
Join Date: Aug 2005
Posts: 3,172
Send a message via AIM to kambodianboi Send a message via Yahoo to kambodianboi
[PHP]Creating a sig

This is an advance script, but I will guide you through it. I hope you might pick up somethings about the script.

To get this script working, you must have GD installed and Enable, you have to edit your php.ini.

Lets start. Start up your PHP editor and create a new document.

Default:
[php]
<?

?>
[/php] Lets plan ahead, what we want for the sig is a background color, 1px border and a text, and maybe some special effects.

Plans
  • Background Color: Red
  • 1px Border
  • Text: First advance script
  • Special: Display server time
  • Special: Display user IP
Ok, we got it planned out, now lets begin.

[php]
<?
// Headers - to manage the script (NO CACHE)
// It will always update.
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

?>
[/php]
The header() function is used to control the page invisibly, it can redirect, control page content and more.

[php]
<?
// Headers - to manage the script (NO CACHE)
// It will always update.
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

header ("Content-type: image/png"); // Defines the image will be PNG
// Create the image
$im = @ImageCreate (400, 150); // Create 400x150 blank image
$background_color = ImageColorAllocate ($im, 255, 0, 0); // Define background color :Red
$text_color = ImageColorAllocate($im, 0, 0, 0); // Define font color: Black
$grey = ImageColorAllocate($im, 144, 144, 144); // Grey

$margin = 10; // Define margin for text

// Borders (Black borders)
imageline($im, 0, 0, 0, 149, $text_color); // Left Line
imageline($im, 0, 0, 399, 0, $text_color); // Top Line
imageline($im, 399, 1, 399, 149, $text_color); // Right Line
imageline($im, 0, 149, 399, 149, $text_color); // Bottom Line

// Insert the Text
imagestring($im, 3, 20, $margin+15, "My first advance script", $text_color);

// Send image data to browser.
ImagePng($im);
?>
[/php]

Out come:


There you have it, your first advance script. Now we can add some special features.
__________________
Xbox 360 - 2 Games - 2 Controllers - 120GB Elite - Dead
PS3 - 23 BD Games - 13 PSN Games - 9 Controllers - 320GB - Alive
Wii - 6 Games - 4 Wiimotes - Alive
PC - Overkill - God like :]
EVO - Needs new clutch & brakes :[

Gaming Generations | XnogarD Production - Soon!!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


vBulletin 3.7.1 ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0