|
I have a index.php page that has the following: <BR><?php include ("random_quote.php") ?><BR> When this runs I get the following errors:"Warning: main(random_quote.php) [function.main]: failed to open stream: No such file or directory in /www/webphpsvr/htdocs/index.php on line 20 Warning: main() [function.include]: Failed opening 'random_quote.php' for inclusion (include_path='.:/usr/local/php5//lib/php') in /www/webphpsvr/htdocs/index.php on line 20"
Here is what is in random_quote.php: <?php /** * Add this line of code in your page: * <?php include "random_quote.php"; ?> */ $quotes[] = "This is a quote"; $quotes[] = "This is another"; $quotes[] = "quote 3"; $quotes[] = "quote 4"; $quotes[] = "quote 5"; $quotes[] = "quote 6"; srand ((double) microtime() * 1000000); $randomquote = rand(0,count($quotes)-1); echo "<p>" . $quotes[$randomquote] . "</p>"; ?>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.