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
please help:put images together
Started by sara933, May 24 2008 12:16 AM
1 reply to this topic
#1
Posted 24 May 2008 - 12:16 AM
|
|
|
#2
Posted 24 May 2008 - 07:59 AM
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?
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.
my code is probably not perfect but I hope that helps some.
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.


Sign In
Create Account

Back to top









