Reply to Re: include won't work for some reason

Your name:

Reply:


Posted by Jerry Stuckle on 10/07/06 01:54

robertcode@gmail.com wrote:
> Hey all, I'm trying to get this include to work but I can't for some
> reason. Each file I'm trying to include is named articles.php, but the
> directories are different. So I set up the link to my include.php file
> like this
>
> <a href="include.php?directory='.$articlename.'">'.$articletitle.'</a>
>
> and on the reciving end
>
> <?php include '/'.$_GET["directory"].'/articles.php'; ?>
>
> The rest of the page comes up, but the incuded part is nowhere to be
> found.
>
> I'd appreciate any help anyone could offer.
>
> Thanks,
> RC.
>

What exactly does $articlename contain?

Also, the way you're accessing it is relative to the root of the file
system. If you want it relative to the root of the webserver, you need
to use:

<?php include $_SERVER['DOCUMENT_ROOT'] .
'/'.$_GET["directory"].'/articles.php'; ?>


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original 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

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