Help - Search - Members - Calendar
Full Version: Php Include
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
krisnixon
Ok, here's the deal. I appreciate the help ahead of time. But I am trying to "Include" a file in a page.

When I do I get the following error no matter what I try to do.

The error is..
CODE
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /www/99k.org/k/r/i/kris/htdocs/photos.php on line 47

Warning: include(http://kris.99k.org/gallery/index.php) [function.include]: failed to open stream: no suitable wrapper could be found in /www/99k.org/k/r/i/kris/htdocs/photos.php on line 47

Warning: include() [function.include]: Failed opening 'http://kris.99k.org/gallery/index.php' for inclusion (include_path='.:/usr/share/php') in /www/99k.org/k/r/i/kris/htdocs/photos.php on line 47


Like for example. My website is . http://kris.99k.org but when I try to include my gallery into a page such as http://kris.99k.org/photos.php

it gives me an error.

on my index page at http://kris.99k.org i have a news script included on the page and it works fine. but i can't get my gallery or any other gallery to show up correctly. any ideas?

It's telling me that file-access is disabled in the server configuration. . ?

Thanks alot,
-kris
Ed
Remove the 'http://' from your include, use fullpaths.
krisnixon
When i use the following php include code

CODE
<?PHP
include("/www/99k.org/k/r/i/kris/htdocs/gallery/");
?>


I get the following error

CODE
Warning: include(/www/99k.org/k/r/i/kris/htdocs/gallery/) [function.include]: failed to open stream: No such file or directory in /www/99k.org/k/r/i/kris/htdocs/photos.php on line 49

Warning: include() [function.include]: Failed opening '/www/99k.org/k/r/i/kris/htdocs/gallery/' for inclusion (include_path='.:/usr/share/php') in /www/99k.org/k/r/i/kris/htdocs/photos.php on line 49


i dont know why.
Adam
Your include() must include a file, you have just put the path to the file.

Try:

CODE
<?PHP
include("/www/99k.org/k/r/i/kris/htdocs/gallery/index.php");
?>


If index.php is not the file you are trying to include - change it to the file you are trying to include.

- This also belongs in the PHP topic.
Sto1c_1
You probably don't need all of that. Refer to the file as you would to an image in your page. You don't need to type out the whole path, just the necessary bit to get it from the folder in which the page is contained to the folder in which the image is contained. PHP is the same. Assuming your page is hosted in htdocs/, all that you should need is "gallery/index.php".
Jordan Parker
try NOT using a direct link !


CODE
<?php
include"./htdocs/gallery/index.php";
?>


Don't uses the Strings " () "
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.