[PHP RELEASE] Input validation. Array support. menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    Danne206's Avatar Contributor
    Reputation
    183
    Join Date
    Jan 2008
    Posts
    717
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [PHP RELEASE] Input validation. Array support.

    Heya. A small release here from me. Hope you'll enjoy it.
    It sure isn't advanced, but it full fills my needs perfectly. There's probably some dumb shit in it, fix it. This is programmed by me, that means no super-duper awesome code, it just works.

    PS. It's made with the $_POST['name'] right now, it can easily be changed to GET or w/e you'd need. Hint: find & replace is awesome.
    PSS. ERROR AND NOTICE PROOF :]. That means isset() etc is used when needed.

    Pretty basic user input (forms) validation, it supports "Normal" forms (a-aA-A0-9), "Email" forms (Basically pretty good pattern for email. I haven't found any holes yet. No, no \n at the end ), "Integer" and "String" should be pretty obvious.

    If it finds any errors, it defines them. More to this:
    If an user fails to enter the (example only) email and username form
    correctly (they are named reg_username and reg_email in this example), it will add this to the $error (a & between each) variable. I.e
    &reg_username&reg_email
    (Why the &? GET redirect support!) It then defines the $error variable (containing all the names of the faulty entered forms) to the x928 constant. (Easy changeable as well.)
    Then, you can use the defined() function to check if it's defined (user failed?), and then do a redirect back to the form if it is.
    * (which should react if GET is on the form names - I have not implemented this, up to you i.e "You entered the username form incorrectly!" next to it, or just make it red. You get it.) . I.e
    * register.php?step=2&reg_username=1&reg_email=1 (Do a shortcut on this, long names are ugly. Or why not POST?)

    NOTES: Normal must be 3 <= characters and mail musat not be < 6 characters, it will fail the check otherwise.
    Change this if it doesn't fit you.

    This is obviously perfect for a user registration, and such. Why not for your personal forum? (You'd probably make your own, but at least you get some inspiration.)

    Example usage files are included.


    DOWNLOAD:
    http://www.djs-gaming.com/priv/ValidateKit.zip

    PSSS. Yes, it DOES support arrays.
    PHP Code:
    $normal = array('form1''form2''form3''form4');
    Form::Validate($normal); 
    There's no limit, and it's actually built for arrays.
    ~DJS-CMS
    Dahnniel [DOT] s [AT] gmail [DOT] com

    [PHP RELEASE] Input validation. Array support.
  2. #2
    Dombo's Avatar Banned
    Reputation
    622
    Join Date
    Nov 2008
    Posts
    1,421
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://be.php.net/manual/en/book.filter.php

    Useful guide on have to use PHP filters (PHP 5.3 and up)
    They have these sort of functions included.

    example:
    filter_var($_POST[field], FILTER_VALIDATE_EMAIL) returns a boolean wether or not the variable is a valid email

  3. #3
    Danne206's Avatar Contributor
    Reputation
    183
    Join Date
    Jan 2008
    Posts
    717
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, I actually didn't know that. Oh well, I hope someone has usage of this.
    Dahnniel [DOT] s [AT] gmail [DOT] com

Similar Threads

  1. [Release] zRestarter | Multiply realm support
    By Mr.Zunz in forum WoW EMU Programs
    Replies: 15
    Last Post: 05-21-2010, 08:20 AM
  2. [RELEASE]Web Registration Script(guided), Secured, 4 steps Registration PHP script
    By Viking.nor in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 07-31-2008, 03:59 AM
  3. Replies: 6
    Last Post: 02-12-2008, 11:48 PM
All times are GMT -5. The time now is 08:42 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search