SitePoint Sponsor

User Tag List

Page 3 of 4 FirstFirst 1234 LastLast
Results 51 to 75 of 99
  1. #51
    I <3 Internet Tekime's Avatar
    Join Date
    Dec 2003
    Location
    Maine
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tabula
    Can someone show some of their input validation classes. These would be interesting to look at. Not necessarily the code to the class, but show the code for using it.
    PHP Code:
    $validate = new validate;
    if(!
    $validate->is_username($_REQUEST['f_username']))
    {
        
    $errors[] = 'Invalid username format';
    }
    etc... 
    Quote Originally Posted by tabula
    Also, could someone tell me what they find so useful about user classes?
    It makes it really easy to create and edit users. My user class is a hybrid DAO/utility/display class, but it works very well for me. For example I can load, edit, and save a user record in just a few lines of code.

    PHP Code:
    if($user->load('tabula'))
    {
        
    $user->set('username''billgates');

        if(
    $user->save())
        {
            
    $gui->dialog('You are now a very rich man!''/index.php');
        }
        else
        {
            
    $gui->error($user->errors'index.php');
        }

    Scriptalicious SEO Scripts
    Save 20% with coupon code SPROCKS


  2. #52
    If it aint Dutch it aint much Kilroy's Avatar
    Join Date
    Oct 2003
    Location
    The Netherlands
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Eric.Coleman
    Off Topic:

    http://wact.sourceforge.net/index.php/FormValidation

    I started fixing this page, who wants to help me go through the pages and clean them up?
    I'll help a bit.

  3. #53
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use Session class that handles all my session vars in a db or file, it is really useful to handle the session your own way and much reliable than php's built in session functions.

    other than this a db handling class and user validation.
    also for some addin widgets like dynamic nav panel, i fell comfortable doing it through a class with a defined interface.

  4. #54
    SitePoint Zealot Ap0s7le's Avatar
    Join Date
    Jul 2003
    Location
    Lousiville, KY
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I really don't use any, I plan on starting and this thread gave me some good ideas where to start.

    I have a couple questions, when someone rolls their own session handling like nuke_g33k stated what does that include?

    I've started a rough DB class based on the one I studied from PHPBB, and a databank class with some of the functions I had with arrays of Countries, States, Zips and Canadian provinces.

    TIA

  5. #55
    I <3 Internet Tekime's Avatar
    Join Date
    Dec 2003
    Location
    Maine
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ap0s7le
    I have a couple questions, when someone rolls their own session handling like nuke_g33k stated what does that include?
    Depends on the implementation, but I use a session class to store, load, and modify sessions and session data in a database. For each session I store a record with the session ID, user ID, client IP address, user agent, creation time, update time, expiration, etc. This way I don't have to store any critical data in the session itself, and I can (optionally) validate the session ID against the IP address, user agent, etc for maximum security.[*]

    In as many words, I say $sess = new session and I get an object that has a validated session, the user's ID, IP address, and upon instantiation automatically looks for an deletes expired sessions from the database.

    [*] Validating sessions against IP address is extremely unreliable. Clients with dynamic IPs will not be able to keep a session alive. But, I have always toyed with the idea of creating a percentage based algorithm of sorts that could compare the IP address, user agent, and any other identifiable information and create a percentage validity rating for the client. The site owner could specify what level of security to use (e.g. a minimum threshold of 50% validity for sessions). For intranet sites you could crank up security if you know everyone's on a specific IP, and for pub sites you could put it back to normal. Anyway, I'm rambling now.
    Scriptalicious SEO Scripts
    Save 20% with coupon code SPROCKS


  6. #56
    Massimiliano Bruno Giordano sid egg's Avatar
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    1,280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tekime
    Depends on the implementation, but I use a session class to store, load, and modify sessions and session data in a database. For each session I store a record with the session ID, user ID, client IP address, user agent, creation time, update time, expiration, etc. This way I don't have to store any critical data in the session itself, and I can (optionally) validate the session ID against the IP address, user agent, etc for maximum security.[*]

    In as many words, I say $sess = new session and I get an object that has a validated session, the user's ID, IP address, and upon instantiation automatically looks for an deletes expired sessions from the database.

    [*] Validating sessions against IP address is extremely unreliable. Clients with dynamic IPs will not be able to keep a session alive. But, I have always toyed with the idea of creating a percentage based algorithm of sorts that could compare the IP address, user agent, and any other identifiable information and create a percentage validity rating for the client. The site owner could specify what level of security to use (e.g. a minimum threshold of 50% validity for sessions). For intranet sites you could crank up security if you know everyone's on a specific IP, and for pub sites you could put it back to normal. Anyway, I'm rambling now.
    I'm quite interested in seeing an implementation of this, however, if you don't want to share it, that's fine... :-) And your percentage based idea sounds really cool
    GamesLib.com - the slickest, most complete and
    easily navigatible flash games site on the web.

  7. #57
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by velocd
    Mostly:

    1. DAL Class
    2. DAL::ErrorHandling Class (logs DB errors, sends emails, etc.)
    3. Template Class
    4. User Class (authentication functions, privilege handling, etc).

    Recently I've extended the template class for my job to support "on-the-fly" dynamic handling of form requests (POST & GET), using XMLHttpRequest. Lots of intricate Javascript and DOM handling involved in it. The eval() function of Javascript makes it particularly easy though, by echo()ing Javascript in my methods. It's made our forms more effective to use on an end-user standpoint (less redirects and refreshes), plus quicker to code.. ironically. While our public forms are still former style, the interfaces that most our employees use (whose computers are all under Firefox) will be using XMLHttpRequest methods.

    Although somewhat off-topic, if you haven't messed with XMLHttpRequest (in conjunction with Javascript DOM) you should. It's really awesome.

    (I must also mention replacing any drop down menus that have huge lists of results, like from a query, with an XMLHttpRequest autocomplete input box is definitely the way to go. Much faster execution/render times of pages.)
    For me remote scripting (XMLHttpRequest) will dominate the web interface in the future - so called rich client - the advantage is so obvious. I'm surprised that it hadn't done so yet but as for me all my future sites will use almost exclusively remote scripting (the one in my sig will serve as experimental lab). For the funny story I have implemented remote scripting solution for a friend's company in 1998 and it was published on jars.com and javaboutique (it's still there and it still even works with netscape and IE 3.0 and jdk 1.02 ) well sure at that time people really didn't see the advantage except the editor reviewer at jars.com there is really some strong inertia in software engineering to adopt novel ideas .

  8. #58
    Scary's On The Wall
    Join Date
    Apr 2003
    Location
    PA
    Posts
    518
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm suprised only one other person mentioned a Form class. They are quite nice... Especially when it comes to when a user makes an error, its very simple just to highlight the fields which have errors.

    http://www.smackjeeves.com, is currently under development, but if you go to register and make some blatant errors, you'll see what I mean.

  9. #59
    SitePoint Zealot Ap0s7le's Avatar
    Join Date
    Jul 2003
    Location
    Lousiville, KY
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tekime, thank you for that.

    I can see the benefits to having a session class. Mmm, so much work and so little time. heh

    Thanks

  10. #60
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i use session class to store variables and objects(in serialize form) ,

    i serialize my objects and retrieve it anywhere else, this makes my code more neat and easily understandable.

  11. #61
    SitePoint Zealot Ap0s7le's Avatar
    Join Date
    Jul 2003
    Location
    Lousiville, KY
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello nuke_g33k, I'm learning OOP and like the idea of the whole session class.
    Would you be willing to show me an example? Either here or in private, I don't mind.

    Thank you for your time.

  12. #62
    I <3 Internet Tekime's Avatar
    Join Date
    Dec 2003
    Location
    Maine
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sid egg
    I'm quite interested in seeing an implementation of this, however, if you don't want to share it, that's fine... :-) And your percentage based idea sounds really cool
    I would love to, but unfortunately I have to keep most of my good code close due to licensing. It has always been a pipe dream to get my toolkit GPL or similar license... it may happen someday. I might have an old session class kicking around though, if I find anything that isn't too horrendous I'll be sure to post.
    Scriptalicious SEO Scripts
    Save 20% with coupon code SPROCKS


  13. #63
    I <3 Internet Tekime's Avatar
    Join Date
    Dec 2003
    Location
    Maine
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ap0s7le
    Tekime, thank you for that.
    You're welcome.

    I can see the benefits to having a session class. Mmm, so much work and so little time. heh
    You can say that again!
    Scriptalicious SEO Scripts
    Save 20% with coupon code SPROCKS


  14. #64
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    maybe we should have a class respository somewhere in conjuction with forum for example code and the bare bones of classes, nothing production grade or someone's closed source stuff, but things that just get the idea across. that way you can post links, esp for those topics that show up over and over again

  15. #65
    SitePoint Addict Tim_Rogovets's Avatar
    Join Date
    Aug 2003
    Location
    Odessa, Ukraine
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    Quote Originally Posted by mx2k
    maybe we should have a class respository somewhere in conjuction with forum for example code and the bare bones of classes, nothing production grade or someone's closed source stuff, but things that just get the idea across. that way you can post links, esp for those topics that show up over and over again
    That's an excellent IDEA! Sounds great.
    CEO of Grandiz! - a team based in Odessa, Ukraine.
    Designing and developing sophisticated web apps on CodeIgniter!

  16. #66
    SitePoint Guru
    Join Date
    Oct 2001
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    maybe we should have a class respository somewhere in conjuction with forum for example code and the bare bones of classes, nothing production grade or someone's closed source stuff, but things that just get the idea across. that way you can post links, esp for those topics that show up over and over again
    Note: this is meant positively:

    I'll beat Manuel to it: there are already a lot of places where you can post your classes, such as thing called phpclasses.org.

  17. #67
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Captain Proton
    Note: this is meant positively:

    I'll beat Manuel to it: there are already a lot of places where you can post your classes, such as thing called phpclasses.org.
    right, but phpclasses.org is for those wanting to grab for use, and some are ill written or have bad documentation, i'm thinking more on the lines where all the examples are well written with in depth documentation, that are meant more for learning than live production use. and i know of plenty of places like phpclasses

    zend, phpfreaks, devshed, phpbuilders etc. and then you have to shift through tons of classes and if someone is new, its hard for them to know what is considered to well written verses what is a bad example. and as others have told me times before, we should really try to help in keeping good standards not only for ourselves but for others as well.

    alot of classes that i have found have things intertwined, like emailing and error handling all in one class. which would be eaiser to learn if they were seperated into single classes.
    Last edited by mx2k; Apr 12, 2005 at 08:31.

  18. #68
    SitePoint Addict Tim_Rogovets's Avatar
    Join Date
    Aug 2003
    Location
    Odessa, Ukraine
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm thinking: there's a number of database abstraction classes out there. And if I needed to choose one - I'd be more than glad to try out a class written by someone I've talked to on the forums, someone who has good reputation in my eyes.
    And if members-powered classes reprository existed at sitepoint - that's be the first (and perhaps the last) place I'd go in search for classes.
    CEO of Grandiz! - a team based in Odessa, Ukraine.
    Designing and developing sophisticated web apps on CodeIgniter!

  19. #69
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tekime
    In as many words, I say $sess = new session and I get an object that has a validated session, the user's ID, IP address, and upon instantiation automatically looks for an deletes expired sessions from the database.
    Does you class do anything that you couldn't do with session_set_save_handler and friends?

    Douglas
    Hello World

  20. #70
    SitePoint Zealot Ap0s7le's Avatar
    Join Date
    Jul 2003
    Location
    Lousiville, KY
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I like mx2k's idea. The only reason I ask questions here rather than other forums is I do respect a lot of the people here.

    Now regarding PHPClasses, I hardly ever go there. I just don't like the site.

    later

  21. #71
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Cool

    Quote Originally Posted by rainadaman
    is there any site that show , which classes should we use in good programming.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  22. #72
    SitePoint Wizard
    Join Date
    May 2003
    Location
    Berlin, Germany
    Posts
    1,829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Tim: Maybe we should ask for something like a php Advanced subforum that holds class libraries...

  23. #73
    SitePoint Guru
    Join Date
    Dec 2003
    Location
    oz
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Someone should go through this thread, take all the regularly used stuff and put it in a list for a framework to implement. Tho being open source, implementation is painfully slow and may never eventuate.

    That's what i see as the prime advantage of .Net - that they build all the commonly used stuff into the framework for everyone. And then there is a common interface for these things that all .Net developers who use it know about and don't have to re-learn at each job.

    Not intending to start a .net vs php thread. Just thought it would be nice if php took some of those ideas and worked them in somehow.

  24. #74
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You should look at Prado then. Its PHP5 only though!!
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  25. #75
    SitePoint Guru
    Join Date
    Dec 2003
    Location
    oz
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by asp_funda
    You should look at Prado then. Its PHP5 only though!!
    Wow. I guess it's almost brand new considering its PHP5.
    Just wondering if this is becomming popular and used? Any idea?

    Thanks for the link btw.


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
  •