Re: Including PHP scripts on same server [message #171906 is a reply to message #171900] |
Thu, 20 January 2011 19:38 |
Captain Paralytic
Messages: 204 Registered: September 2010
Karma:
|
Senior Member |
|
|
On Jan 20, 5:25 pm, jwcarlton <jwcarl...@gmail.com> wrote:
> On Jan 20, 7:02 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
>
>> On Jan 20, 6:18 am, jwcarlton <jwcarl...@gmail.com> 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.
|
|
|