RE: [PHP] newbie: PHP flow ....
| From: | Maxim Maletsky \(PHPBeginner.com\) | Date: | Fri, 28 Sep 2001 03:48:12 +0000 |
| Subject: | RE: [PHP] newbie: PHP flow .... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-69109@lists.php.net to get a copy of this message | ||
Think of it this way: with php code "all-on-one" you will have a big
file and thus slow to compile and hard to maintain (if too long, while
way easier if code is pretty simple)
And now this of this: you have an application that sends emails: you
split things in different files, in one choose emails in another edit
emails and with other send them. So different tasks are better to manage
separately.
Another way is: having one page which, under certain conditions,
includes ONLY necessary files from your library. At that point you have
a great portability, but perhaps, slower development times if the script
is simple. Yet this is my favorite way. I usually carry my own libraries
and use them a sort of in C style - include needed libraries only.
And over all - in PHP there are no such rules, passing variables is
very, very easy and at the end it will all become up to you.
Hope it clears you a bit.
Maxim Maletsky
www.PHPBeginner.com
-----Original Message-----
From: Jean-Christian Imbeault [mailto:jean_christian@hotmail.com]
Sent: venerdì 28 settembre 2001 4.53
To: php-general@lists.php.net
Subject: [PHP] newbie: PHP flow ....
Ok, I'm a programmer and I've just started playing around with PHP. Once
thing I cannot seem to grasp is what the "flow" of a PHP program is
supposed
to be.
By this I mean that I find myself thinking that every choice/click I
give
the user leads him to a different page, hence a different PHP file. But
then
I see code examples and it looks like every click just reloads the same
page
but some variable gets passed in and a different part of the page's code
gets executed.
The problem I have with my "click, go to another page" mentality is that
I
find it hard to pass variables from one php file to another. (but I'm a
newbie so maybe it's not that hard, but I find sessions variable don't
seem
to stay around if you changes pages).
The problem I have with "put all the code on one page and just pick
which
part you want executed" is that it makes it hard for me to see
flow-control
and worse yet I can't figure out how to control the flow in the first
place
^_^
Don't know but I think if I can "grok" this part of PHP then everything
else
will be easy.
And opinion, suggestions or links to information would be greatly
appreciated!
Jc
_________________________________________________________________
Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net To
contact the list administrators, e-mail: php-list-admin@lists.php.net