You are here: Re: The name of the PHP file « All PHP « IT news, forums, messages
Re: The name of the PHP file

Posted by Paul Charlton-Thomson on 10/10/37 11:19

Sounds like your trying to do what I have done on my site ... I pass a
variable into the same PHP page which fetches the included content but then
also captures it as the page title etc ...

So I continually reload index.php with two variables 'f' and 'p' for folder
and page.

So I could link to .../index.php?f=help&p=how_to_log_in

This is the relevant code in my index.php page ... using PHP 5

if(file_exists($_GET['f'] . "/" . $_GET['p'] . ".php")) include $_GET['f'] .
'/' . $_GET['p'] . '.php';

then ...

print '<H1>' . $_GET['f'] . ': ' . str_replace("_", " ", $_GET['p']) .
'</H1>';

Hope that helps.


"Kees Boer" <keesboer@integrity-computing.net> wrote in message
news:xCGue.68337$gc6.55577@okepread04...
> Thanks, that helps. Now I need to learn how to write some function in PHP,
> dealing with string and substrings, that I can actually subtract the part
of
> the filename that I need. Do you have a suggestion, where the syntax of
> functions can be found?
>
> Kees
>
> "www.douglassdavis.com" <douglass_davis@earthlink.net> wrote in message
> news:1119550849.518185.134060@z14g2000cwz.googlegroups.com...
> >
> >
> > Try $_SERVER['PHP_SELF']
> >
> > You need to get everything after the slash...
> >
> > --
> > PHP Stuff:
> > www.douglassdavis.com
> >
>
>

 

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

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