Jump to content
xisto Community
Sign in to follow this  
friso

Random Image / Random Header S.O.S.

Recommended Posts

im building a website, and i need some helpi got 3 frames, navigation, top and main, but i want the top banner to have a new tagline with every refresh, just like the header, it dont really matter what coding it is, as long as it's not to weird :P

Share this post


Link to post
Share on other sites

im building a website, and i need some help

 

i got 3 frames, navigation, top and main, but i want the top banner to have a new tagline with every refresh, just like the header, it dont really matter what coding it is, as long as it's not to weird ^_^

<{POST_SNAPBACK}>


I can help you out but I need to understand what you mean. What are you referencing when you say tagline and header. Are these logos, ads or text of some sort?

 

If you had a link to this site, or a screenshot with some editting of the areas you want to work on, that would be good to help understand.

 

There's many ways to achieve this, depending on the size of it, if it's only a few images then I would not use a database, but if there is quite a lot of images then I would use a database.

 

If it's a small size, what I would do is read the directory's contents, grab only image extensions or the images I want to use, count how many I've grabbed as this will be our maximum number, store it in an array, work on the random script noting our maximum value, have it point to an image and display that. There would be a few checks to make sure that errors will not occur or if major errors occur I would want an automated email to me, but since explaining security would mean going through a lot of can do and would do theories for better security you may need to pull up a chair and just think about all the possibilities.

 

Well get back to me on more of this and I will try to help you out.

 

Cheers,

 

 

MC

Share this post


Link to post
Share on other sites

hmm....well, if you want to make a random picture show with PHP, i recommend using a sode somewhat like the one described on this tutorial: http://www.ethicsdesigns.com/rg-erdr.php?_rpo=t

i've used it before and it works well. Not too sure if this is what you're searching for though =P

Share this post


Link to post
Share on other sites

If you prefer a script to generate imgs with text inside or put a text on each img of yours site..

<?php/************Random Signature V1,0******************//* CodeName: Randys v1.0;                         *//* Coder: K22 - klakice[AT]swissinfo[DOT]org;                *//* Date: 16-17/10/2004;                            *//* License: GNU/GPL;                               *//***************************************************//*******Config********//*Bar x dimension*/$barx=600;/*Bar y dimension*/$bary=25;/*Font type [1..5], Default 5*/$font=5;if(file_exists("frases.txt")){$frases=fopen("frases.txt","r");$x=0;while (!feof($frases)) {   $buffer[$x] = fgets($frases, 4096);   $x++;}$val=rand(0,($x-1));$code=$buffer[$val];}else $code="My programmer isn't very good, He does an error in my config :(";$code=ereg_replace("\n","",$code);$code=ereg_replace("\r","",$code);$len=strlen($code);$xpos=(($barx/10)-$len);$xpos=$xpos*6+12;header("Content-type: image/jpeg");$image=imagecreatetruecolor($barx,$bary);$text_color = imagecolorallocate($image, 0, 150, 255);imagestring ($image, $font, $xpos, 4, $code, $text_color);imagejpeg($image);imagedestroy($image);?>

Share this post


Link to post
Share on other sites

I would like to help, but I don't really understand you.If you want help quickly, it is suggested that you give as much information as you can.The few seconds extra that you take to give information, could get your answer much quicker.When I do that, I always give as much info as I can and I usally get something that works within the first 2 responses.

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.