× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



php.ini:
; UNIX: "/path1:/path2"  
include_path = ".:/QOpenSys/php/include"

You would place whatever scripts that you want to include in this path.  If you 
simply want to "/COPY" something in your script, use require or require_once 
instead.

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]On
Behalf Of Scott Johnson
Sent: Monday, March 27, 2006 2:12 PM
To: WEB400@xxxxxxxxxxxx
Subject: [WEB400] include_path and php


I am having a heck of a time trying to figure out how to set the include_path 
setting in the php.ini file. Where does this setting default to or "start" from?

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 thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.