Welcome Guest, Not a member yet? Register   Sign In
Extended form validation
#1

[eluser]Patroklo[/eluser]
Hi, we have extended the form validation library that devbro made some time ago and added some new methods about time and date validation. Also we have tweaked a bit the file upload validations to get rid of some bugs and use real mime validation instead of only extension validation (that gave the user the chance of uploading illegal files only changin the extension of the file).

Version of Codeigniter 2.x library stored in Github (with Php 5.2 support)

Version of Codeigniter 3.x library stored in Github (with Php 5.2 support)

Both librarys have the same methods as described in the next comment.

If you think that there are some new validations that could be useful and we haven't added it to the library, don't hesitate to tell it to us and we will try to add them asap.
#2

[eluser]Patroklo[/eluser]
Forgot to add the new methods you can use in the library:


file_required Checks if the a required file is uploaded.
file_size_max[size] Returns FALSE if the file is bigger than the given size.
file_size_min[size] Returns FALSE if the file is smaller than the given size.
file_allowed_type[type] Tests the file extension for valid file types. You can put a group too (image, application, word_document, code, zip).
file_disallowed_type[type] Tests the file extension for no-valid file types
file_image_maxdim[x,y] Returns FALSE if the image is smaller than given dimension.
file_image_mindim[x,y] Returns FALSE if the image is bigger than given dimension.
file_image_exactdim[x,y] Returns FALSE if the image is not the given dimension.
is_exactly
  • Check if the field's value is in the list.
    is_not
    • Check if the field's value is not permitted.
      valid_hour[type] Check if the field's value is a valid hour.
      valid_date[date_format] Check if the field's value has a valid format. If not provided with a format, it will use the standard value..
      valid_range_date[date_format] Check if the field's value has a valid range of two date formats. If not provided with a format, it will use the standard value..




Theme © iAndrew 2016 - Forum software by © MyBB