You are here: Re: Newbie PHP question: 'hiding' code on server from View Source « PHP Programming Language « IT news, forums, messages
Re: Newbie PHP question: 'hiding' code on server from View Source

Posted by Boldgeek on 01/16/07 21:52

murrayatuptowngallery@yahoo.com wrote:

> I have just started figuring out PHP as a server-side approach to
> something I did in Javascript.
>
> I never was able to figure out CGI on a remotely hosted web server the
> few times I tried (maybe wasnt' enabled?), but PHP is working fine...at
> least no problems at all, not my usual experience.
>
> What I would like to do is have the web page visitor access one page
> that 'calls' another so that the code isn't visible thru a web
> browser's 'View Source'.
>
> Can a .php or .htm file in the 'public', 'www', or 'html' directory
> access a .php file in for example the CGI-BIN area, or is there another
> way to do this?
>
> A visual example would probably help me more than a description.
>
> Thank you
>
> Murray


PHP has a command called

require ("page.php");

which will pull another page from the server into the current page,
whether this is PHP or HTML.
You can use it much like an "include" command to pull in PHP routines
or to pull in static chunks of HTML.
If you try to pull in a CGI file - eg somethign written in perl, it
will NOT execute on the server before being included, it will pull in
the raw source code and THEN try to execute it.

 

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

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