Professional Web Applications Themes

Discussion on program structure - PHP Development

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 ...

  1. #1

    Default Discussion on program structure

    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!
    Jam Guest

  2. #2

    Default Re: Discussion on program structure

    "Jam Pa" <org> wrote in message
    news:243.153.2... 

    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 .

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


    Kimmo Guest

  3. #3

    Default Re: Discussion on program structure

    Jam Pa wrote:
     

    Why not? What you've described is a front-controller pattern. If you're a
    patterns kind of person, you use the FC to multiplex the M[V]C objects.

    C.
    Colin Guest

Similar Threads

  1. Replies: 1
    Last Post: May 1st, 03:24 PM
  2. Where is the old Classified discussion
    By Dscarry in forum Macromedia ColdFusion
    Replies: 0
    Last Post: March 21st, 09:52 PM
  3. Process folder structure into new structure
    By Bryan in forum PERL Beginners
    Replies: 3
    Last Post: April 27th, 04:46 AM
  4. Performance Discussion
    By Bobbo in forum ASP
    Replies: 7
    Last Post: July 3rd, 12:51 PM
  5. G5 Discussion
    By Bill B. Johnson in forum Mac Applications & Software
    Replies: 8
    Last Post: June 28th, 08:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139