Re: Including PHP scripts on same server



On Jan 20, 5:25 pm, jwcarlton <jwcarl...@xxxxxxxxx> wrote:
On Jan 20, 7:02 am, Captain Paralytic <paul_laut...@xxxxxxxxx> wrote:

On Jan 20, 6:18 am, jwcarlton <jwcarl...@xxxxxxxxx> wrote:> I currently have several functions scripted on one page.

No you don't. A "page" (or more correctly a document) is what someone
sees on a browser. It is not the same as a php file.

One php file may generate many html pages or many php files may
generate only 1 page.

Do not confuse the 2.

I'm really not sure how I would have said this correctly. What I'm
referring to aren't really functions, either; they're sections of a
single page that is created (executed?) via PHP.

For example, consider the Yahoo.com homepage. What if each section
(the navigation, the main news in the middle, "Trending Now" to the
right, the Google ad, "Marketplace" below, and "Popular Travel" beside
of it) were each including a separate PHP file to create them? Would
this be slower, or the same, as compared to them being coded in a
single file?

Why does it matter. If you're that concerned about speed of execution,
why are you using php in the first place? You should code your site in
C.

And even if you had a single php file, think of all those newline
characters that have to be read in. Better put everytihing on a single
line.

Oh and don't have variable names that are longer than necessary, it
all increases the time the file takes to be read, so just use single
letters for all variable names.
.



Relevant Pages

  • Re: Trying to change global array value with $POST
    ... Each php file is much much larger than that ... When the client requests a web page, the server fetches it. ... Nothing is saved from the previous execution; if you want something to be saved, you must do it yourself, i.e. in a database, cookie or the session storage. ...
    (comp.lang.php)
  • Execute and kill a process
    ... I need to simulate the execution of code on another thread an the only way I ... found is to launch a .php file with popen. ... but in the .php file may be an infinite loop that I ... call pcloseor the process terminate itself? ...
    (comp.lang.php)
  • Re: how to mark php document as cachable (expires only when php file changes)
    ... > a html file does not have to be reloaded ... > However my above php file will always create the same output independent ... > browser understand, that the php file does not have to be refetched, ... But caching can be very confusing, and results may differ from one setup to ...
    (comp.lang.php)
  • Re: Unable to open php file in IE6
    ... You don't need to reconfigure the browser. ... Microsoft MVP [Windows XP Shell/User] ... it.So what shld i do or re-config my browser to accept any PHP file? ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: why can not get the correct return value?
    ... I run a simple php file as: ... When run on the command line, it is running under the userid that you ... When run from a browser, the web server is running it under ... Yes,I know your meaning,My web server is apache,I had changed the user ...
    (comp.lang.php)