![]() |
php help needed!
I have this simple php script..
Code:
<? |
are all your quotes saved in the quotes.txt file and is that file in the same directory as the random quote file?
|
Yes, and it has one qoute per line.
|
Quote:
below is the code I used and an example of the quotes.txt file... index.php <html> <head> <title>Untitled</title> </head> <body> <? $quoteFile = "quotes.txt"; //File holding qoutes $fp = fopen($quoteFile, "r"); //Opens file for read $content = fread($fp, filesize($quoteFile)); $quotes = explode("\n",$content); //Put quotes into array fclose($fp); //Close the file srand((double)microtime()*1000000); // randomize $index = (rand(1, sizeof($quotes)) - 1); //Pick random qoute echo $quotes[$index]; //Print quote to screen ?> </body> </html> quotes.txt lick my balls eat my ass I like paste link to working example of above... http://www.pornfinders.com/quote/index.php |
It works for me too. Maybe my question wasn't clear but I want to be able to show more then one qoute.
Instead of getting "lick my balls" I want to get "lick my balls" "eat my ass" Or all three qoute if i want to. Any way of specificing how many qoutes it shows? |
Code:
<? |
Quote:
|
Many thanks!
Works perfectly! Should have gone here directly, would have saved me a few hours of googling without any results. Thanks again, you saved my day :) |
Or a shorter version....
Code:
<? |
That only shows a bunch of numbers..
|
Oops. Fast and wrong ;)
I forgot that it returned the keys and not the values. This one works: Code:
<? |
All times are GMT -7. The time now is 12:26 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123