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

Your name:

Reply:


Posted by Alan Jones on 05/14/07 02:59

On Sun, 13 May 2007 22:42:14 -0400, Norman Peelman
<npeelman@cfl.rr.com> wrote:

> I see what you mean... look at it this way... when retrieving a file
>via HTTP:// the $_SERVER['REQUEST_URI'] will be set to the uri that
>contains it. HINT: the -containing- uri. When retrieving from the
>filesystem $_SERVER['REQUEST_URI'] is coming from the original page
>therefor pointing to the right /index.php or whatever. It's like there
>are two $_SERVER['REQUEST_URI'] variables but they don't collide.
>
>example:
>
>index.php
>---
><?PHP
>echo $_SERVER['REQUEST_URI'].'<br>';
>include('http://insert.your.domain/page2.php'); // http transport
>include('page2.php'); // filesystem
>echo $_SERVER['REQUEST_URI'].'<br>';
>?>
>
>page2.php
>---
><?PHP
>echo $_SERVER['REQUEST_URI'].'<br>';
>?>
>
>---
>
>will output:
>
>/index.php
>/page2.php
>/index.php
>/index.php
>
>obviously your not after /page2.php
>
>Norm

Shhhhh! (lol) I was waiting to see if the others here would figure
it out. :D Yes, as per my reply to shimmyshack in alt.php and you
in ACLP, using the file system path to make the include fixed the
problem.

Again, thanks, I'm now able to use the script you recommended.
I took out the || ($_SERVER['REQUEST_URI'] == '/') part. It didn't
end up being necessary. And, I'm using PHP_SELF instead of
REQUEST_URI...

if ($_SERVER['PHP_SELF'] == '/index.php'){include('signature.php');}

I am now a very happy coder/camper. :)

[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

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