Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 12, 2022, 05:16:24 PM

Login with username, password and session length
Members
  • Total Members: 3842
  • Latest: Kokoro
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 50
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 1
Guests: 43
Total: 44

Author Topic: Random Quote/HTML/PHP/IMGes etc  (Read 4465 times)

0 Members and 1 Guest are viewing this topic.

142TeeTH

  • Guest
Random Quote/HTML/PHP/IMGes etc
« on: November 11, 2006, 06:01:11 PM »
Code: [Select]
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
« Last Edit: November 24, 2006, 02:18:05 PM by 142TeeTH »

142TeeTH

  • Guest
Re: Random Quote/HTML/PHP/IMGes etc
« Reply #1 on: November 19, 2006, 11:21:40 AM »
no comments?

akulion

  • Guest
Re: Random Quote/HTML/PHP/IMGes etc
« Reply #2 on: November 19, 2006, 01:41:04 PM »
good job

Balaganoff

  • Guest
Re: Random Quote/HTML/PHP/IMGes etc
« Reply #3 on: November 19, 2006, 11:59:50 PM »

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

 ;)

142TeeTH

  • Guest
Re: Random Quote/HTML/PHP/IMGes etc
« Reply #4 on: November 24, 2006, 02:22:49 PM »
thanks.
and Balaganoff nice eye =)