Tagged Questions
5
votes
3answers
114 views
Regex to validate font names
/((([\w -]+)|("[\w -]+"))( *, *)?)+/
http://refiddle.com/18ql
I'm trying to use a PHP regex to sanitize a user input for a list of fonts. The above one seems to ...
2
votes
2answers
79 views
Validator extended to handle domain objects / entities
I started improving my validator library even more, and I think I'm at the last final element (domain object / entity validations) before I can gladly say that my Validator library is completely done ...
15
votes
2answers
366 views
Allowing users to input a safe subset of HTML
I am currently working on a project that requires users to input text that may or may not be formatted (if it helps, just think of it as a Stack Exchange clone, even though that's not quite accurate). ...
5
votes
2answers
99 views
Possible security issues in email validation
I need feedback on this code regarding security issues.
...
3
votes
1answer
81 views
Shortening if-statements of displaying errors
Is it possible to shorten this piece of PHP code?
Honestly, I think it does not look clean but like a mess.
...
3
votes
1answer
59 views
6
votes
3answers
205 views
JS validation and submission with AJAX
I've got an assignment to do pure JS validation as well as submit with AJAX. Here is the code I've got so far. I'm wondering if I can do away with the whole "reason" bit. That was because it was ...
7
votes
4answers
1k views
Password checker in PHP
I have written a password checker using PHP, consisting of many if else statements. Is there any possible way to shorten this code?
...
1
vote
2answers
393 views
Validating uploaded images
I have attempted to write a method that checks that images being uploaded are valid.
...
1
vote
2answers
72 views
Form validation for sporting events
I am coding a site where users submit sporting events.
When submitting an event there are a lot of fields that need to be validated.
This is the method I wrote to valid the fields:
...
2
votes
0answers
315 views
Tiny MVC - Handling validation / sanitization in a model
I'm fairly new to MVC concepts and PHP input validation.
I'm open to all input, but I'm largely wanting to know if the following:
Follows the MVC pattern correctly - if not, how can I change it to ...
0
votes
1answer
555 views
Form validation - security and input specification
So I'm working on a register form and I have four fields: name, username, email and password. I pick up the values of these fields in jQuery and depending on if all the fields are filled, I pass them ...
2
votes
1answer
4k views
My login with AJAX and PHP
In your opinion, do I need to do all these validations. I thought to do well and stay safe but I seriously raises the question if it isn't slower.
jQuery code
...
2
votes
1answer
755 views
How to properly store error messages and display them with OOP?
I have a class that I am using to initialize a form for editing. Once the form is submitted, data validation is done through the setters of my class. Good or bad input will be set in order to ...
6
votes
3answers
451 views
5
votes
2answers
168 views
Is this a good object oriented design for a file validator?
I'm working on a module that downloads a file saves it then validates if the file contents are valid.
For simplicity lets assume that the file consists of 3 segments: Header, Body & Footer.
Now ...
4
votes
1answer
530 views
Ajax form validation
This is my first ever attempt at Ajax form validation, and everything works as expected, the final true example will hold a lot more input fields than in my testing scripts which are below.
The file ...
1
vote
1answer
338 views
Validating forms data
Here is a class that I made to validate forms data. I will really appreciate any criticism and hints.
...
3
votes
3answers
487 views
Email text validator
I'm using this pattern for the first time and wanted to check if this is the correct implementation.
class.validator.strategy.php
...