You are here: Re: 'nested conditional' that can identify parent page? « PHP Programming Language « IT news, forums, messages
Re: 'nested conditional' that can identify parent page?

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.

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация