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 17:37

On Sun, 13 May 2007 09:41:17 -0500, Jerry Stuckle
<jstucklex@attglobal.net> wrote:

>Alan,
>
>$_SERVER['REQUEST_URI'] does give the uri used to fetch the page. I'm
>not sure what you mean by 'child' file. Are you using frames? Maybe if
>you post the code you're using (including that in the 'parent' and
>'child' pages) it will be more clear.

Thanks for helping me. :)

To isolate the process, I have recreated the scenario using new
files, file names, and a new folder called 'test'.

http://jalanjones.com/index2.php

: Inside of index2.php is...

<html><head><title></title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head><body>

<p>This sentence is in the index2.php file.</p>

<p><?php include('http://jalanjones.com/test/content.php');?></p>

<p>Why is there a numeral one (1) at the end? (scratching
head)<br><br></p>

</body></html>

: ...and inside of /test/content.php is...

<html><head><title></title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head><body>
<table cellpadding="10" style="border:1px solid #333333"><tr><td>

<p><br>This table is in the content.php 'include' file.</p>

<p>REQUEST_URI result:&nbsp;&nbsp;&nbsp;<b>
<?php echo($_SERVER['REQUEST_URI']);?></b></p>

<p>The result (/test/content.php) is the name of the include/child
file, not the parent page; the URL.</p>

<p>Below is phpinfo() run from inside the include file. Please see
the PHP Variables section...<br><br></p>

<?php echo phpinfo();?>

</table></tr></td>
</body></html>

Can anyone identify the culprit? Again, I am very new to PHP so it
is probably something only a clueless newb would do. :D

>And as Schraalhans indicated, commands which relate to the underlying
>filesystem (i.e. link, fopen, include, etc.) reference the file system
>directly. So if you use absolute paths (beginning with '/'), it is the
>root directory of the file system. But your host has limited you so all
>you can access are files in /hom/httpd/vhosts/jalanjones.com/httpdocs
>and /tmp.

Thanks, I hope to avoid using link().

 

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

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