LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 607 users online 223938 members 974 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
Brinkmannjg
Music: Pink Floyd, Brand New, Underoath, Radio...
Mood: Plain
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
12 online / 11 MPM
Fresh Topics
  LiveWire / Technical Forums / Digital Arts & Music Technology / Adding Reply

Adding Reply
Archived Topic: It will not be bumped to the top of the forum.
Topic PHP/Dynamic Images?
Membername   Not a member? Sign Up Free (takes 20 seconds)
Password   Forgotten your password?
Post

Font:   Size:   Color:

FAQ Keyword Search:
Post Options
Favorites Manager
Notify me of new replies to this topic by email
Notify me of new replies to this topic by private message
Original Post
ranman Posted at 2:14 am on July 2, 2006
Does anyone have experience with creating a dynamic image? like one that displays your IP address and stuff...

These are my two terrible attemepts...

http://ranman.phpnet.us/sig1.php this one does not work but here is the code
Code:

<?
header('Content-type: image/gif');
srand( microtime() * 100000 );
$num = rand( 1, 9 );

switch ( $num )
{
case 1 : $img_url="sig1.gif"; break;
case 2 : $img_url="sig2.gif"; break;
case 3 : $img_url="sig3.gif"; break;
case 4 : $img_url="sig4.gif"; break;
case 5 : $img_url="sig5.gif"; break;
case 6 : $img_url="sig6.gif"; break;
case 7 : $img_url="sig7.gif"; break;
case 8 : $img_url="sig8.gif"; break;
case 9 : $img_url="sig9.gif"; break;
}

$image = imagecreatefromgif("$im_url");

$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);

$ip = $_SERVER['REMOTE_ADDR']; // the ip address.

srand( microtime() * 100000 );
$num1 = rand( 1, 9 );

switch ( $num1 )
{
case 1 : $message="You wish you were as cool as me..."; break;
case 2 : $message="I eat noobs"; break;
case 3 : $message="The Ranman will own you"; break;
case 4 : $message="Ranman is currently... coding"; break;
case 5 : $message="Ranman is currently... eating"; break;
case 6 : $message="Ranman is currently... hacking"; break;
case 7 : $message="Ranman is currently... doing nothing"; break;
case 8 : $message="Hacked"; break;
case 9 : $message="Simplicity is best"; break;
}

imagestring($image, 5, 0, 0, "Your ip is $ip\n$message", $white); // this creates the text


imagegif($image);
imagedestroy($image);
?>

this one works but not well

http://ranman.phpnet.us/siggy.php
Code:

<?php
header('Content-type: image/gif');
$im_url = "sig3.gif"; // needs to end in .gif
$image = imagecreatefromgif("$im_url");

$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);

$ip = $_SERVER['REMOTE_ADDR']; // the ip address.

imagestring($image, 50, 50, 50, "Your ip is: $ip\nHaxx3d", $white); // this creates the text

imagegif($image);
imagedestroy($image);
?>


If this is in the wrong place could the appropriate authorities please move the post to the correct place?

Replies
AlwaysAr0und Posted at 2:51 am on Dec. 20, 2006
Post from this position was omitted due to content violations
AlwaysAr0und Posted at 2:48 am on Dec. 20, 2006
Post from this position was omitted due to content violations
AlwaysAr0und Posted at 2:47 am on Dec. 20, 2006
Post from this position was omitted due to content violations
All 3 previous replies displayed.