Jump to content

please help:put images together

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
sara933

sara933

    Newbie

  • Members
  • Pip
  • 6 posts
hi
i want to put some images(gotten from mysql database)together that it seems one picture ,and i want to put a random background each time it is loaded for it.how can i do this?could anyone help me please?
Regards

#2
chili5

chili5

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 7,247 posts
You would have to use the GD library or some other graphics library to do this.

But why don't you just make one image with all the images in paint and print it to the page?


echo "<img src=\"img.jpg"\" />";


as for the random background, i would put the images in a database and make a random number and pull the image from the database that corresponds to the image with that id number.


<?php

srand ((double) microtime( )*1000000);

$random_number = rand(0,10);

?>



<body background="<?php

$image = mysql_query("SELECT * FROM db WHERE Id='$random_number'");

echo $image; 

?>


my code is probably not perfect but I hope that helps some.