Using

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, all -

Being still fairly new to PHP, I thought I'd ask a few more questions and get on to the right track here, developing correct coding habits before I start to teah myself incorrect habits.

One of my biggest questions is how to go about writing an application that uses a single file, i.e. all my html ACTION='s would go to, pretty much, $_SERVER['PHP_SELF'].

From what I understand, I make a flat file (flat, as in, not using OOP at this time), and then make one large procedural flow, flipping "triggers" at various points to tell the script at which "stage" it's at, something like the following:

if ($a = 1) {
	// do first thing
} elseif ($a = 2) {
	// do second thing
} elseif ($a = 3) {
	// do final thing
}

Now, that all makes sense, but I'm wondering if it's the "correct" thing to do, or would I be better off swapping out "// do x thing" for a require() function to split things up into different files, calling a different set appropriate for the "step" that we are on.

This may sound like a silly question, but like I said, I feel that I should get myself off on the right foot as I start to do stuff that is more infolved.

Any feedback would be greatly appreciated.

Best Regards
-Dan Trainor

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux