Professional Web Applications Themes

forms, validation and elegance... - PHP Development

hello, i have a website to do which will needs many forms, and i'm looking for an elegant way to handle them... i would like to know how do you use php and forms , how do you validate user entries (on the server side, i'm not interested in javascript in this post) and when needed how do you display error messages for bad or missing entries. i was thinking of using directly html and "include" them inside full php pages, put here my trouble is that i still need to have php code inside what i would like to ...

  1. #1

    Default forms, validation and elegance...

    hello,

    i have a website to do which will needs many forms, and i'm looking for an
    elegant way to handle them...

    i would like to know how do you use php and forms , how do you validate user
    entries (on the server side, i'm not interested in javascript in this post)
    and when needed how do you display error messages for bad or missing
    entries.

    i was thinking of using directly html and "include" them inside full php
    pages, put here my trouble is that i still need to have php code inside what
    i would like to be full html, at least for default value or when editing...
    i can also think of having a php class to create a form but here it is the
    opposite : html code inside php.

    so i would like to have your opnion, thoughts on it, and how do you proceed
    to separate php code which handle forms and theirs validations from html
    used for presentation.

    thanks.

    ps : if you are not interested in it maybe you could tell how you handle
    multilingual site... (by having everything in a database, by having some
    kind of translation table, or as many pages as availables languages, or ???)


    GrelEns Guest

  2. #2

    Default Re: forms, validation and elegance...

    There's probably some pretty good libraries out there for dealing with
    forms..
    I created a home-brew set of functions / procedures..

    basically has 2 parts.

    a form definition array where I define every field, whether or not
    it's required (can be dependant on other fields), valid format (can be
    a reg-exp), default value (if any), a "label", and any other params
    that would be found in the input tag..

    I define the layout of the form..

    then I pass this array to a "handle form" function which prints out
    the form.. it highlights any missed or invalid fields, etc..

    works on multi-part/page forms, etc.. custom check-box graphics,
    etc..


    "GrelEns" <NOTNEEDEDfr> wrote in message news:<4028f9fa$0$28760$free.fr>... 
    Brad Guest

  3. #3

    Default Re: forms, validation and elegance...

    Brad Kent wrote: 

    thanks for the answer,

    is this librairy publicly available ?

    best,


    GrelEns Guest

  4. #4

    Default Re: forms, validation and elegance...

    GrelEns wrote: 
    >
    >
    > thanks for the answer,
    >
    > is this librairy publicly available ?
    >
    > best,
    >
    >[/ref]

    There's a PEAR class that does a lot of what you're seeking:
    http://pear.php.net/package/HTML_QuickForm/

    I haven't used it (yet), but it looks handy.

    Regards,

    - Dan
    http://blog.dantripp.com/
    Dan Guest

  5. #5

    Default Re: forms, validation and elegance...

    You can look at http://phpformgen.sourceforge.net I just downloaded it, but
    haven't used in in production. It looks quite good, though...


    "GrelEns" <NOTNEEDEDfr> wrote in message
    news:4028f9fa$0$28760$free.fr... 
    user 
    post) 
    what 
    editing... 
    proceed 
    ???) 




    cfm Guest

Similar Threads

  1. Flash Forms - Server Side Validation - Back Button
    By RobinK in forum Coldfusion Flash Integration
    Replies: 0
    Last Post: January 3rd, 06:13 PM
  2. Flash Forms and Javascript Validation
    By zach1023 in forum Coldfusion Flash Integration
    Replies: 1
    Last Post: October 11th, 10:10 AM
  3. Flash Forms Query Data Validation
    By cfmichael in forum Macromedia ColdFusion
    Replies: 0
    Last Post: May 4th, 01:22 AM
  4. Validation bug in CF7 Flash forms
    By pgrwriter in forum Coldfusion Flash Integration
    Replies: 0
    Last Post: April 6th, 07:06 PM
  5. Rich flash forms and validation functions
    By game_on in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: February 23rd, 07:58 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