Jump to content

Just a quick question


Maleficus1055

Recommended Posts

http://www.uzzisoft.com/

 

 

 

Are people just afraid of looking up something on Google? Seems most of these questions now are within the top 5 results.

[hide=Funny Quotes]

So you sucker punched a kid in the back of the head? Good job.
What scares me is that you're like 10 years old.
-.- im not that freaking young
You were a couple years ago.
It's not racist if its true.
Hmm... I wonder how one goes about throwing someone out a window in a mystic fashion :-k

 

The mental image for that is freaking awesome.

[/hide]

- I dont need to "get a life." I'm a gamer - I have LOTS of lives!

Link to comment
Share on other sites

You could also do it if you have a webhost that supports PHP by pointing the URL to a PHP page which returns a random image.

 

 

 

*scratches head*..

 

 

 

Things to do by next year: Learn PHP....lol

 

 

 

What would the code look like for that lol? And does it have to be PHP, or could it be just html/css (or maybe Java Script?).

[hide=Funny Quotes]

So you sucker punched a kid in the back of the head? Good job.
What scares me is that you're like 10 years old.
-.- im not that freaking young
You were a couple years ago.
It's not racist if its true.
Hmm... I wonder how one goes about throwing someone out a window in a mystic fashion :-k

 

The mental image for that is freaking awesome.

[/hide]

- I dont need to "get a life." I'm a gamer - I have LOTS of lives!

Link to comment
Share on other sites

HTML and Javascript is rendered on the actual browser so they cannot do what you need, also HTML is not capable of making random decisions.

 

 

 

PHP is what is called a server side language, which means that the script is run on the web server and all your browser receives is the output from the PHP script. So the only thing the PHP page would return is the URL to the image, the code would go something like this:

 


<?php

$RNImage=rand(1,3);

echo 'http://home.berzerk.co.uk/Images/'.$RNImage.'.jpg';

?>

 

And here's a quick explanation:

 

 

 

$RNImage is a variable that contains a random number generated by the rand function.

 

rand(1,3) selects a random number between 1 and 3.

 

echo is what echoes information to your browser, and you can see I have placed $RNImage instead of the image name.

 

 

 

This script will select a random image from 1.jpg, 2.jpg and 3.jpg.

 

 

 

Addition:

 

I have just realised this will not work on this forum, [garden tool] hum. Scrap all the above :(. If I can figure out a way to get it working I will let you know, but I'm not feeling well at the moment and am going back to bed so it won't be soon.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.