TinyPortal

Development => Block Codes => Topic started by: 142TeeTH on November 12, 2006, 01:01:11 AM

Title: Random Quote/HTML/PHP/IMGes etc
Post by: 142TeeTH on November 12, 2006, 01:01:11 AM
echo "<center>";
$quotes = file("http://path/to/file.txt");
$quote = rand(0, sizeof($quotes)-1);
echo $quotes[$quote];
echo "</center>";


each line of code in the txt file is seperated by a ENTER hit

Since it randomly selects a line of code to replace it.you can insert php into the txt file, and it will display it as php.

and you can use it to randomly display text/img banners etc

ps remember that since it displaying the code randomly is the actual code.you need to write "echo" and other code when displaying regular HTML in the txt file

Edit - Fixed center code
Title: Re: Random Quote/HTML/PHP/IMGes etc
Post by: 142TeeTH on November 19, 2006, 06:21:40 PM
no comments?
Title: Re: Random Quote/HTML/PHP/IMGes etc
Post by: akulion on November 19, 2006, 08:41:04 PM
good job
Title: Re: Random Quote/HTML/PHP/IMGes etc
Post by: Balaganoff on November 20, 2006, 06:59:50 AM

echo "<center">";
echo "<center>";

;)
Title: Re: Random Quote/HTML/PHP/IMGes etc
Post by: 142TeeTH on November 24, 2006, 09:22:49 PM
thanks.
and Balaganoff nice eye =)