Reply to Re: Discussion on program structure

Your name:

Reply:


Posted by Kimmo Laine on 05/26/05 12:31

"Jam Pa" <anonanon@non-anon.org> wrote in message
news:Xns96627C2149454anonanonnonanonorgjp@213.243.153.2...
> Hi!
>
> Once again I am building a simple app that shows data that users can add
> and manipulate from a form on a web page.
>
> I would like to discuss about simple simple solutions to these common
> problems. Please join in, and add your own comments, and questions.
>
> My question is, whats a clever way of handling the part where user adds
> data?
>
> I have simple solution like this: 'commands' are sent through GET (in url)
> to the server, where index.php or similar file includes other files
> accordingly. Now this doesn't work well with OO where I am headed.
>
> And I need lots of files, basically one or more per 'command' or 'action'.
> Say for instance I have 'add entry' action in a blog. First the app must
> show the user a form from which user can post their entry, then the app
> must handle that data (another php file, ie. clean data up and add it to
> the db) and finally display thanks on the client (third file, xhtml).
> Whew!

I put lots and lots of stuff in a single page. For instance I may have three
different forms and form handlers in a single file. I keep them separate
with something like

if($_REQUEST['list']) {
// something
} else if($_REQUEST['save']) {
// something else
} else if($_REQUEST['delete']) {
// something else
}

Keeps the number of pages small, and since they are all related to same
area, all require the same settings, sessions and libraries, I just modify
the action segments in the middle and I only need to write once the section
where I include all libs and settings and shit.

--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com

[Back to original 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

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