You are here: Using « PHP « IT news, forums, messages
Using

Posted by Dan Trainor on 02/08/05 16:21

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

 

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

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