Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 01-03-2009, 02:43 PM   #41 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Signature Rotation Code

Quote:
Originally Posted by Peter.Cort View Post
aite so i registered my stuff on the 100webspace thing and got that all done. i enabled php 5 (don't know differences between 4,5 and 6...) and then i uploaded the .php file to the ftp. when i put in the link to where the script is located nothing pops up in my sig. Thing is I don't know how to enable GD. ideas?
PM me links to the images you want to use.
__________________

Need website help? PM me!
CrazeD is offline  
Old 01-04-2009, 07:59 PM   #42 (permalink)
zedman3d's Avatar
 
I am of the highest lvl..

Join Date: Oct 2007

Location: Sydney, Australia

Posts: 2,452

zedman3d will become famous soon enoughzedman3d will become famous soon enough

Default Re: Signature Rotation Code

Isnt this very simple? When i did it, it was like one paragraph of PHP and that was it. All i did was use a header redirect.

You definitely dont need to use GD for something like this.
Code:
<?php
$randomN=rand(0,3);
if ($randomN==0)
{ header( 'Location: http://www.example.com/images/SIG1.png' ) ;}

if ($randomN==1)
{ header( 'Location: http://www.example.com/images/SIG2.png' ) ;}

if ($randomN==2)
{ header( 'Location: [http://www.example.com/images/SIG3.png' ) ;}

if ($randomN==3)
{ header( 'Location: http://www.example.com/images/SIG4.png' ) ;}
?>
This was when i was a bit more novice at PHP and used IF constantly. Obviously it will work fine as it is but doing a SWITCH would be more efficient.

In which case, the complete efficient code is:

Code:
<?php

$randomN=rand(0,4);

switch ($randomN) {
case 0:

	header( 'Location: http://www.example.com/images/SIG1.png' ) ;
	break;
	
case 1:

	header( 'Location: http://www.example.com/images/SIG2.png' ) ;
	break;
	
case 2:

	header( 'Location: http://www.example.com/images/SIG3.png' ) ;
	break;
	
case 3:

	header( 'Location: http://www.example.com/images/SIG4.png' ) ;
	break;
	
case 4:

	header( 'Location: http://www.example.com/images/SIG5.png' ) ;
	break;
	
	
default:

    	header( 'Location: http://www.example.com/images/error.png' ) ;
}

?>
All you need to do is upload that (.php) and change the links to your images. Thats it. Then use IMG tags to point to the .php file.
__________________



My pick up line is: I know Vernong.

Trotter: "Ask all the questions you want... whatever we don't know, we'll make
up something that sounds pretty good."

Antec-User: "I have a display now, but the darn system is crash-bandicoot on stock"

Last edited by zedman3d; 01-04-2009 at 08:15 PM.
zedman3d is offline  
Old 01-04-2009, 09:21 PM   #43 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Signature Rotation Code

Well I haven't tested it, but if zedman is correct and it is that simple, then this is even simpler:

Code:
<?php

$pics = array (
		'http://link-to-image.jpg',
		'http://link-to-image2.jpg',
		'http://link-to-image3.jpg',
		'http://link-to-image4.jpg',
		'http://link-to-image5.jpg',
		);

$rand = rand(0,count($pics)-1);

header ('location:'.$pics[$rand]);

?>

__________________

Need website help? PM me!
CrazeD is offline  
Old 01-04-2009, 09:25 PM   #44 (permalink)
Peter.Cort's Avatar
 
TF's First DICE User.

Join Date: Jul 2007

Location: Burlington VT

Posts: 3,976

Peter.Cort will become famous soon enough

Send a message via AIM to Peter.Cort Send a message via MSN to Peter.Cort Send a message via Skype™ to Peter.Cort
Default Re: Signature Rotation Code

so upload that to the site, and then run the [img ]insert-link-to-page-here.php[/ img] in the sig?
__________________
MacBook Pro
C2D T8800 @ 2.66GHz | 4GB DDR3 1066MHz | 9600M GT 256MB | 320GB HDD
24" Acer B243w
Cavalry 1TB Firewire800 External
Peter.Cort is online now  
Old 01-04-2009, 09:28 PM   #45 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Signature Rotation Code

Quote:
Originally Posted by Peter.Cort View Post
so upload that to the site, and then run the [img ]insert-link-to-page-here.php[/ img] in the sig?
Check pm.
__________________

Need website help? PM me!
CrazeD is offline  
Old 01-04-2009, 09:32 PM   #46 (permalink)
Peter.Cort's Avatar
 
TF's First DICE User.

Join Date: Jul 2007

Location: Burlington VT

Posts: 3,976

Peter.Cort will become famous soon enough

Send a message via AIM to Peter.Cort Send a message via MSN to Peter.Cort Send a message via Skype™ to Peter.Cort
Default Re: Signature Rotation Code

woot! and it works


thanks a bagillioN!!!
__________________
MacBook Pro
C2D T8800 @ 2.66GHz | 4GB DDR3 1066MHz | 9600M GT 256MB | 320GB HDD
24" Acer B243w
Cavalry 1TB Firewire800 External
Peter.Cort is online now  
Old 01-04-2009, 09:35 PM   #47 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Signature Rotation Code

If you want more pics, PM me. You can have as many as you want.
__________________

Need website help? PM me!
CrazeD is offline  
Old 01-04-2009, 09:39 PM   #48 (permalink)
zedman3d's Avatar
 
I am of the highest lvl..

Join Date: Oct 2007

Location: Sydney, Australia

Posts: 2,452

zedman3d will become famous soon enoughzedman3d will become famous soon enough

Default Re: Signature Rotation Code

np. :happy:
__________________



My pick up line is: I know Vernong.

Trotter: "Ask all the questions you want... whatever we don't know, we'll make
up something that sounds pretty good."

Antec-User: "I have a display now, but the darn system is crash-bandicoot on stock"
zedman3d is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Signature cards TRDCorolla1 Off Topic Discussion 4 06-15-2008 05:58 AM
PHP: How to modify a downloaded JavaScript code and partly change the code within it? LincolnX Programming Discussions 4 01-25-2008 04:25 PM
Someone take a look at my Java code PnkFloyd27 Programming Discussions 4 06-21-2007 08:11 PM
NEED help with a Javascript code...(mouseover and stuff) Quintox Web Graphics, Design, Digital Images 7 05-02-2007 06:41 PM