IP signature image
header("Content-type: image/png");
$theirip = $_SERVER['REMOTE_ADDR'];
$text1 = "Your IP address is $theirip.";
$text2 = "This is Rydian Morrison's signature.";
$text3 = "And he humps legs. D:";
$mainimage = imagecreate(500,100);
$basecolor = imagecolorallocate($mainimage,0,255,255);
$textcolor = imagecolorallocate($mainimage,200,0,0);
imagefill($mainimage,0,0,$basecolor);
Imagestring($mainimage,4,2,0,$text1,$textcolor);
Imagestring($mainimage,4,2,12,$text2,$textcolor);
Imagestring($mainimage,4,2,24,$text3,$textcolor);
imagepng($mainimage);
imagedestroy($mainimage);
?>
$theirip = $_SERVER['REMOTE_ADDR'];
$text1 = "Your IP address is $theirip.";
$text2 = "This is Rydian Morrison's signature.";
$text3 = "And he humps legs. D:";
$mainimage = imagecreate(500,100);
$basecolor = imagecolorallocate($mainimage,0,255,255);
$textcolor = imagecolorallocate($mainimage,200,0,0);
imagefill($mainimage,0,0,$basecolor);
Imagestring($mainimage,4,2,0,$text1,$textcolor);
Imagestring($mainimage,4,2,12,$text2,$textcolor);
Imagestring($mainimage,4,2,24,$text3,$textcolor);
imagepng($mainimage);
imagedestroy($mainimage);
?>
random quote
function check500($num)
{if ($num >= 500)
{return 500;}
else
{return $num;}}
$quotes = array(
'Quote 1 is this.',
'Quote 2 is this.',
'Quote 3 is this.'
);
$lines = explode("n", wordwrap(('"' . $quotes[array_rand($quotes)] . '"'),
80, "n"));
for ($i = 0, $long = 0; $i < count($lines); $i++)
{ if (strlen($lines[$i]) > $long)
{$long = strlen($lines[$i]);}}
$im = imagecreate(check500($long * 6 + 9), check500(count($lines) * 17 +
3));
$background = imagecolorallocate($im, 0, 0, 0);
$text = imagecolorallocate($im, 255, 255, 255);
imagefill($im, 0, 0, $background);
for ($i = 0, $l = 3; $i < count($lines); $i++, $l += 17)
{imagestring($im, 2, 5, $l, $lines[$i], $text);}
imagerectangle($im, 0, 0, (imagesx($im) - 1), (imagesy($im) - 1), $background);
imagerectangle($im, 1, 1, (imagesx($im) - 2), (imagesy($im) - 2), $text);
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
?>
{if ($num >= 500)
{return 500;}
else
{return $num;}}
$quotes = array(
'Quote 1 is this.',
'Quote 2 is this.',
'Quote 3 is this.'
);
$lines = explode("n", wordwrap(('"' . $quotes[array_rand($quotes)] . '"'),
80, "n"));
for ($i = 0, $long = 0; $i < count($lines); $i++)
{ if (strlen($lines[$i]) > $long)
{$long = strlen($lines[$i]);}}
$im = imagecreate(check500($long * 6 + 9), check500(count($lines) * 17 +
3));
$background = imagecolorallocate($im, 0, 0, 0);
$text = imagecolorallocate($im, 255, 255, 255);
imagefill($im, 0, 0, $background);
for ($i = 0, $l = 3; $i < count($lines); $i++, $l += 17)
{imagestring($im, 2, 5, $l, $lines[$i], $text);}
imagerectangle($im, 0, 0, (imagesx($im) - 1), (imagesy($im) - 1), $background);
imagerectangle($im, 1, 1, (imagesx($im) - 2), (imagesy($im) - 2), $text);
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
?>
Random image from directory
header ("content-type: image/gif");
$path = '/home/rydian/public_html/shop/randomimage/rydian/images/';
$i = 0;
$imgDir = opendir ($path);
while ( $file = readdir( $imgDir ) )
{ $file_type = strrchr( $file, "." );
$is_image = eregi( "jpg|gif|png",$file_type );
if ( $file != '.' && $file != '..' && $is_image )
{ $images[$i++] = $file; }}
closedir ($imgDir);
srand( (double) microtime()*1000000 );
$image_name = $path . '/' . $images[rand( 0,sizeof( $images ) -1 )];
$imgSize = GetImageSize( $image_name );
if ( $i == 0 )
die();
readfile("$image_name");
?>
$path = '/home/rydian/public_html/shop/randomimage/rydian/images/';
$i = 0;
$imgDir = opendir ($path);
while ( $file = readdir( $imgDir ) )
{ $file_type = strrchr( $file, "." );
$is_image = eregi( "jpg|gif|png",$file_type );
if ( $file != '.' && $file != '..' && $is_image )
{ $images[$i++] = $file; }}
closedir ($imgDir);
srand( (double) microtime()*1000000 );
$image_name = $path . '/' . $images[rand( 0,sizeof( $images ) -1 )];
$imgSize = GetImageSize( $image_name );
if ( $i == 0 )
die();
readfile("$image_name");
?>