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 Alan Jones on 05/13/07 03:26

On 12 May 2007 19:51:19 -0700, ZeldorBlat <zeldorblat@gmail.com>
wrote:

>> First of all, thank you very much for clueing me in on this area of
>> programming. Without your help, I would still be very lost, but is
>> there a way to make basename, or a similar function, simply return
>> the filename of the parent page; the page the include is in? Thanks
>> again, I really appreciate any help I can get.
>
>Yes -- look at the following URL:
>
><http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server>
>
>and try the various variables available to see what they return.

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.

Again, thanks for racking your brain on this with me. I'm at a
total loss... :(

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");

Warning: link(): open_basedir restriction in effect.
File(/index.php) is not within the allowed path(s):
(/home/httpd/vhosts/jalanjones.com/httpdocs:/tmp) in
/home/httpd/vhosts/jalanjones.com/httpdocs/index_body.php on line 46

Thanks :)

 

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

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