Author Topic: PHP quote display script  (Read 1968 times)

Offline Sava

  • Level 13
  • *
  • Posts: 101
  • Reputation: +3/-15
  • It's just me
    • View Profile
PHP quote display script
« on: September 28, 2006, 07:34:38 PM »
Quote
<?php
########################
# Made by Sava - ssavaa@gmail.com #
########################

// The name of your quote file
$quote_file = "quotes.txt";

// Open the quote file
$fp = fopen($quote_file, "r");

// Read the contents and tokenize the file to individual quotes
$quotes = fread($fp, filesize($quote_file));
$array = explode("\n",$quotes);
fclose($fp);

// Find a random quote
srand((double)microtime()*1000000);
$array_index = (rand(1, sizeof($array)) - 1);

// Show the random quote
echo $array[$array_index];

?>


In case you need one for your website. It's quite easy to use. Just make a quotes.php and put this code in it. Then make the quotes.txt or whatever you choose the name to be and put your quotes in it. Html in the text is also enabled. It will read the text as is. This means you can use <br> <marquee> and other html tags


In case you find this script usefull and want to thank me you can add me a karma point here :D
« Last Edit: September 28, 2006, 07:42:10 PM by Sava »

Offline smiley

  • Level 13
  • *
  • Posts: 101
  • Reputation: +0/-7
    • View Profile
Re: PHP quote display script
« Reply #1 on: September 30, 2006, 09:10:41 AM »
Why cant we just get he scripts for free anyways?

Offline Zeggy

  • Global Moderator
  • Level 35
  • *****
  • Posts: 1,187
  • Reputation: +13/-4
    • View Profile
Re: PHP quote display script
« Reply #2 on: September 30, 2006, 11:53:57 AM »
Why cant we just get he scripts for free anyways?

What scripts?

Offline smiley

  • Level 13
  • *
  • Posts: 101
  • Reputation: +0/-7
    • View Profile
Re: PHP quote display script
« Reply #3 on: September 30, 2006, 01:56:41 PM »
The scripts you need 100 posts for.

Offline Zeggy

  • Global Moderator
  • Level 35
  • *****
  • Posts: 1,187
  • Reputation: +13/-4
    • View Profile
Re: PHP quote display script
« Reply #4 on: October 01, 2006, 06:06:52 AM »
Well, they are free in a way :)
You don't need to pay for them, just make posts!

Offline Pug307

  • Level 21
  • *
  • Posts: 244
  • Reputation: +6/-1
    • View Profile
Re: PHP quote display script
« Reply #5 on: October 12, 2006, 03:58:24 PM »
I need to make 100 posts so looks like I am going to be waiting a long time lol



Offline Mgccl

  • Level 7
  • *
  • Posts: 33
  • Reputation: +1/-0
    • View Profile
    • WebDevLogs
Re: PHP quote display script
« Reply #6 on: November 09, 2006, 10:41:38 PM »
humm, this is one of the simplest Quote system...
yeah. There is really no point posting it because..
I think like all PHPer makes this in like 1 day after learning PHP...

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal