PDA

View Full Version : PHP Image Rotator



LeTomb
25-05-2006, 05:01 PM
Well this is a really simple script for a random signature. The same code as used in J0shIsBackLol's signature.


<?php
header("Content-type: image/png");

$images[] = "URL OF IMAGE";
$images[] = "URL OF IMAGE";

srand ((double) microtime() * 1000000);
$randomimg = rand(0,count($images)-1);

$im = imageCreateFromPng($images[$randomimg]);

imagepng($im);
imagedestroy($im);
?>

Sygon.
25-05-2006, 05:07 PM
And he didnt twll you that your signature needs tobe png for that code ^^^

LeTomb
25-05-2006, 05:09 PM
Well, i coded it myself but who cares, png is the best.

Flauvo
25-05-2006, 05:09 PM
imageCreateFromPng

I think that tells us it does :)


I think this is adapted from dd if im right?

LeTomb
25-05-2006, 06:15 PM
Wth is DD?

Flauvo
25-05-2006, 07:05 PM
Dynamic Drive

nets
25-05-2006, 08:06 PM
I had one ages ago, I also made a script which says the person's IP etc aswell. They're pretty simple.


<?php
header('content-type: image/gif');
$images = array('image1.gif','image2.gif','image3.gif');
include($images[rand(0,sizeof($images)-1)]);
?>

Mentor
25-05-2006, 10:43 PM
Yea, i made one ages ago, althogh since my last host didnt support GD, i used the include function to get the image data, simliar to nets

Jamie.
26-05-2006, 04:10 PM
right 0.o how do i use in sig ?

Flauvo
26-05-2006, 06:34 PM
You dont.

Sigs only support basic html like <b><i><u><div align="center>

No php

Tomm
26-05-2006, 06:36 PM
You dont.

Sigs only support basic html like <b><i><u><div align="center>

No php

ROFL! No. You just save the php file on your site and use www.mysite.com/path/to/php/file.php

LeTomb
26-05-2006, 06:37 PM
If you save this as a php file, you can use it as an image.

:Blob
26-05-2006, 06:41 PM
If you save this as a php file, you can use it as an image.

You can, if it includes a image in it, or it will just be blank

LeTomb
26-05-2006, 06:43 PM
header("Content-type: image/png");

It treats it as an image.

nets
26-05-2006, 06:53 PM
You dont.

Sigs only support basic html like <b><i><u><div align="center>

No php
It's as if it was an image. You can change the MIME types to allow you to have the same extention as an image.

LeTomb
26-05-2006, 07:02 PM
I doubt anyone will use this anyway.

Jamie.
26-05-2006, 08:45 PM
thnks i am dumb u do no ;l

Want to hide these adverts? Register an account for free!