TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 18, 2024, 04:15:25 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 112
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 40
  • Total: 41
  • @rjen

Random Quote/HTML/PHP/IMGes etc

Started by 142TeeTH, November 12, 2006, 01:01:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

142TeeTH

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



Balaganoff


142TeeTH