LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 712 users online 221719 members 1543 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
akallen
Supportiveness: 87.50%
Mood: Flirty
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
5 online / 38 MPM
Fresh Topics
  LiveWire / Technical Forums / Digital Arts & Music Technology / Viewing Topic

PHP/Dynamic Images?
Should this be in the programming forum?
Replies: 3Last Post Dec. 20, 2006 2:51am by AlwaysAr0und
Welcome to LiveWire!
We're Stronger Together.
Join the Community
Single page for this topic Email Print Favorite
( ranman )


Connoisseur

Patron
Reply
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?


2:14 am on July 2, 2006 | Joined: June 2006 | Days Active: 367
Join to learn more about ranman Hawaii, United States | Straight Male | Posts: 2,229 | Points: 7,929
LiveWire Humor
Post from this position was omitted due to content violations
Post from this position was omitted due to content violations
Post from this position was omitted due to content violations
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Digital Arts & Music Technology / Viewing Topic