Probably not the best coding, but get over it.PHP Code:<?php
session_start ();
/**
* @website InterStudios.co.uk
* @author James Rozee
*/
switch ( $_GET [ 'cmd' ] )
{
case 'link':
if ( $_SESSION [ 'url' ] === '' )
{
header( 'Location: http://google.co.uk' );
}
else
{
header( 'Location: http://' . $_SESSION[ 'url' ] . '/' );
}
break;
default:
if( !function_exists( 'exif_imagetype' ) )
{
function exif_imagetype( $filename )
{
if( ( list($width, $height, $type, $attr) = getimagesize( $filename ) ) !== false )
{
return $type;
}
return false;
}
}
/* PHP.net *above* */
// Add images to the array below, you can have as many as you want. Btw its ur job 2 do the size enit fosho
$images = array( array ( 'img.jpg', 'url2site.com' ),
array ( 'img2.jpg', 'url2site2.com' ),
array ( 'img3.jpg', 'url2sitex.com' )
);
// Choose image to display!
$image = $images [ array_rand ( $images ) ];
$image_source = $image [ 0 ]; // url 2 img
$image_url = $image [ 1 ]; // url 2 link
$image_type = exif_imagetype ( $image_source );
if( $image_type == 1 )
{
header('content-type: image/gif');
$img = imagecreatefromgif ( $image_source );
imagegif ( $img );
imagedestroy ( $img );
}
elseif ( $image_type == 2 )
{
header('content-type: image/jpeg');
$img = imagecreatefromjpeg ( $image_source );
imagejpeg ( $img );
imagedestroy ( $img );
}
elseif( $image_type == 3 )
{
header('content-type: image/png');
$img = imagecreatefrompng ( $image_source );
imagepng ( $img );
imagedestroy ( $img );
}
else
{
// if it comes to this, your a noob. I swear 2 god
}
$_SESSION [ 'url' ] = $image_url;
}
?>
How to use it?
Link the image, (eg call that php file index.php)
so in HTML it be like
and to make it link to the website you requested like thisHTML Code:<img src="index.php">
or in BB CODEHTML Code:<a href="index.php?cmd=link"> <img src="index.php"> </a>
HTML Code:[url="http://kg-hosting.co.uk/sig/index.php?cmd=link"] [IMG]http://kg-hosting.co.uk/sig/index.php[/IMG] [/url]





Reply With Quote

