• Log in or sign up for an account here: https://www.sythe.org/login

Tutorial: Creating Dynamic Signature using php

Rshopper

Apprentice

Banned
Joined
Jan 21, 2007
Sythe Gold
0
Messages
685
Age
36
Location
NH, US
First, know that you will need a webserver supporting php. Other than that, you need: a [working] brain and a small amount of php knowlege.

Lets begin.

Code:
<?php
 
?>
If you don't know what this does then you need to go brush up on php.

Code:
$image = imagecreate(150, 50);
Create a blank 60x30 image in the server's memory.

Code:
$bgColor = imagecolorallocate ($image, 0, 0, 0);
Give the image a black (RGB-0,0,0) background.

Code:
$textColor = imagecolorallocate ($image, 225, 255, 255);
Give the image a cyan foreground color.

Code:
$rand = rand(1, 5);
Generate a random number from 1 to 5. This will be used to select a random message in a second.

Code:
switch ($rand) {
case 1:
   $message = "Another Response #1";
   break;
case 2:
   $message = "Another Response #2";
   break;
case 3:
   $message = "Another Response #3";
   break;
case 4:
   $message = "Another Response #4";
   break;
case 5:
   $message = "Another Response #5";
   break;
}
Generate a message from the random number and place it inside $message.

Code:
imagestring ($image, 5, 5, 8, $mesage, $textColor);
Write the message to the image using the text color specified earlier.

Code:
header("Expires: Mon, 5 Jun 1999 05:00:00 GMT"); 
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); 
header("Cache-Control: no-store, no-cache, must-revalidate"); 
header("Cache-Control: post-check=0, pre-check=0", false); 
header("Pragma: no-cache"); 
header('Content-type: image/jpeg');
Send the appropriate headers to the client.

Code:
imagejpeg($image);
imagedestroy($image);
Send the image data to the client and then delete it to free up memory on the server.

This is just the beggining. And your sigs will look pretty crappy with just this code. It is up to you to add bells and whistles to it. Have fun.
 
Not really that unique. Just do a google for 'php dynamic sig' and you'll get tons of nearly the same thing you're doing. Try something more, unique, kind of, like a matrix kind of thing, or an image verification system, those aren't really done as much as what you did.
 
how about something that displays the date time, browser info, ip, resolution, color depth; something to that extent, I think most, if not all can be done in php.
 
Not exactly what I was expecting... I think I'll post how to get your stats off RS just for the hell of it.
 
Is it possible? Does runescape have some developers kit or something?

Or is it done through third party apps or something?
 
It's possible. You can leech the stats off the highscores and then parse then into variables with a little regex.

RuneScape = DK? Dream on lol. Jagex wants to STOP Third party development for their game.
 
Runescape Gamblingrunescape gambling
Back
Top