friso 0 Report post Posted November 24, 2004 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 Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 5, 2004 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
ChronicLoser 0 Report post Posted December 5, 2004 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=ti'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
marijnnn 0 Report post Posted December 5, 2004 if it's for banners, you can name them "banner1.gif", banner2.gif,...banner10.gifand then in your page you put<img src="banner<? echo random(0,10); ?>.gif"> or something alike. check out the random function at http://php.net/manual-lookup.php?pattern=random〈=en&scope=404quickref Share this post Link to post Share on other sites
k221405241470 0 Report post Posted December 9, 2004 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
cryptwizard 0 Report post Posted December 12, 2004 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