Reply to Re: 'nested conditional' that can identify parent page?

Your name:

Reply:


Posted by Schraalhans Keukenmeester on 05/13/07 07:44

At Sun, 13 May 2007 03:26:41 +0000, Alan Jones let his monkeys type:

> On 12 May 2007 19:51:19 -0700, ZeldorBlat <zeldorblat@gmail.com>
> wrote:
>
>[snip]
>
> I went thru that page last night and the most promising seemed to
> be 'REQUEST_URI', which is supposed to output, "The URI which was
> given in order to access this page; for instance, '/index.html'."
>
> However, both...
>
> echo ($_SERVER['REQUEST_URI']);
>
> and...
>
> echo basename($_SERVER['REQUEST_URI']);
>
> ...returned the name of the file it is in, the include 'child' file,
> and not the actual page URL accessed; /index.php. I need the
> include script to know if it is being run within index.php.
>

It _should_ tell you the top level calling script. Show us what you
are doing exactly please. Btw, I am no fan of include files behaving
differently depending on where they're called from. What if your script
name changes ?

> BTW, might you or anyone be able to help with understanding
> 'open_basedir restriction'? I received the following error when trying
> to use the link() function...
>
> link ("/index.php","/index_body.php");
>

Open_basedir is a php setting telling the server the top_level directory
from which files can be opened in your scripts. It's commonly set to point
to your httpdocs dir. (In php.ini)
You got this warning because you tried linking files from your server's
root directory. Link takes a filepath, not a url. In other words, remove
the / from the arguments. (Or provide a full path to the file):

link ("index.php","index_body.php");

Using the phpinfo() function you can see if open_basedir is set and if so,
to what directory.

HTH
Sh.

[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

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