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

Recent

Welcome to TinyPortal. Please login or sign up.

March 01, 2024, 02:19:15 AM

Login with username, password and session length
Members
  • Total Members: 3,881
  • Latest: fords8
Stats
  • Total Posts: 195,080
  • Total Topics: 21,209
  • Online today: 71
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 62
  • Total: 62

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