You are here: Re: include won't work for some reason « PHP Programming Language « IT news, forums, messages
Re: include won't work for some reason

Posted by Pedro Graca on 10/07/06 01:17

robertcode@gmail.com wrote:
> <?php include '/'.$_GET["directory"].'/articles.php'; ?>

The include file is fetched from the file system.
You are trying to fetch /<QUERYSTRING_DIRECTORY>/articles.php
----------------------- ^

You can either omit the '/' (and make sure the QUERYSTRING_DIRECTORY
exists as a subdirectory of the one the script is running from) or
specify the full path to the articles.php script(s).

<?php
$article_dir = $_GET['directory'];

### You will need to write the `directory_is_valid()` function :)
if (directory_is_valid($article_dir)) {
include 'C:/Apache/htdocs/' . $_GET["directory"] . '/articles.php';
} else {
### For simplicity sake, just exit with an error message
exit('Invalid directory.');
}
?>

--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация