Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Edinburgh, UK
    Posts
    402
    Thanks
    2
    Thanked 1 Time in 1 Post

    OOP Form Generator and Validator Tutorial

    I'm looking to build a form generator and validator in an OOP manner, but am struggling to find a decent tutorial that goes through the different methods of building one up.

    Does anyone have a link to one that is worth a look?

    Many thanks in advance,
    Rich

    "An expert is a person who has made all the mistakes that can be made in a very narrow field."

  • #2
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    hi,

    why wud you want to build one yourself im sure there is one out there that you can use. I currently use the code igniter framework and this contains all the validation and form build tools. Also the user guild is one of the most useful i have used before so wud recommend having a look.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Edinburgh, UK
    Posts
    402
    Thanks
    2
    Thanked 1 Time in 1 Post
    Quote Originally Posted by mic2100 View Post
    why wud you want to build one yourself im sure there is one out there that you can use.
    Thanks Mic for your reply - I have looked at codeigniter and it looks like a great framework. However, I'm interested in building one because I have already built a framework for everything else that I need my site to do, and now just need to add the functionality of forms and validation. Hence I'm looking for a tutorial or tutorials to explain their ideas so I can build one up for what I need.

    Are there any tutorials that people can think of? I've tried searching but get very spurious results.

    Thanks again,
    Rich

    "An expert is a person who has made all the mistakes that can be made in a very narrow field."

  • #4
    Regular Coder
    Join Date
    Nov 2007
    Location
    Leeds, UK
    Posts
    514
    Thanks
    24
    Thanked 19 Times in 19 Posts
    Classes are realy easy
    Code:
    class newClass{
        var $var;
    
        function method(){
        }
    }
    Then you load it in $new = new newClass;
    Then you $new->var - gives var
    or $new->method() run the method its that easy
    The only thing to remember is when using a class var like the $var inside a method you use $this->var = 'bla';
    Inside a method is a basic function you like its own script file so you have have $newVar = 'this'; then outside of that function running $newVar dose not exists
    Working towards a Internet where we don't have website just browser applications Kill the Hyper-link and say hello to 3D Games in the browser :)

  • #5
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    there is one other solution i can think of and that is

    http://pear.php.net/search.php?q=form&in=packages


  •  

    Posting Permissions

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