input-validation

Validating a form for email exploits is not working

Hello, I have a contact form in my website. I made a class to handle the whole process. But there is something not working in it. I have 2 functions to check for exploitation and they are not working. I don't know what's wrong with them, so here they are : private function _validateExploit($val) { $exploitPattrens = array('conten...

Why client-side validation is not enough ?

I saw here that: As you probably already know, relying on client-side validation alone is a very bad idea. Always perform appropriate server-side validation as well. Could you explain why server-side validation is a must ? ...

A logical method of displaying post submit error messages using php

//deal with individual form section posts //-->Faction Name if(isset($_POST['factionname'])){ $unsani_faction_name = $_POST['faction']; $new_faction_name = str_replace(",", "", $unsani_faction_name); $faction_name = mysql_real_escape_string($new_faction_name); $faction_name = preg_replace('/\s\s+/', ' ', $faction_name);//...

ASP.NET Request Validation Exception Even When Validation Is Disabled

...

jQuery input value

We have some input elements on the page: <input type="text" class="lovely-input" name="number" value="" /> User types a number he wants to see. How to watch for this input value. with some options? They are: If user types a digit more than 100, change the value of input (on fly, without page refresh) to 100. If he types digit less ...

A potentially dangerous Request.Form value was detected, but ValidateInput is false

Good morning! I Have an issue with a wysiwyg editor that saves html to my database. On my news articles page, it works fine. I have <httpRuntime requestValidationMode="2.0" /> in my web.config, and [ValidateInput(False)] above my edit http post action, and yet my other page with the same wysiwyg editor is rejecting my request wi...

Preventing special character input to html text field

I have an input text field that needs to be limited as to what characters can be typed in. As one form of defense against faulty input, I'm trying to not even let the user type in incorrect things. The input can be [a-zA-Z-._] characters and is limited to 32 characters. <input id="aliasEntry" type="text" maxlength="32"> As you can s...

blacklisting vs whitelisting in form's input filtering and validation

which is the preferred approach in sanitizing inputs coming from the user? thank you! ...

Unexpected doctrine validation error about length when setting the field null

I have a field that is defined as follows: class Subcategory extends BaseSubcategory {} abstract class BaseSubcategory extends Doctrine_Record { public function setTableDefinition() { // ... $this->hasColumn('meta_description', 'string', 255); // ... } // ... } Here's what the table looks like...

Trying to use a while statement to validate user input C++

I am new to C++ and am in a class. I am trying to finish the first project and so far I have everything working correctly, however, I need the user to input a number to select their level, and would like to validate that it is a number, and that the number isn't too large. while(levelChoose > 10 || isalpha(levelChoose)) { cout << "...

Australian bank lookup via BSB, using Javascript

Is there a means of looking up a bank name & branch through Javascript? Perhaps an external service or an complete data-set that can be hosted internally and accessed through JSON? ...

Creating basic PHP script to add lines to a webpage.

I'm predominately a Java guy, which is why I need some assistance on what I assume is rather simple to do in PHP (and rather simple with Java too, although perhaps a bit... verbose). Simply put, I want to construct a webpage which has a list of string items that users have added. At the bottom of the page would be a place in which a use...

ASP.Net MVC 2 Model Validation Regex Validator fails

I have following property in my Model Metadata class: [Required(ErrorMessage = "Spent On is required")] [RegularExpression(@"[0-1][0-9]/[0-3][0-9]/20[12][0-9]", ErrorMessage = "Please enter date in mm/dd/yyyy format")] [DataType(DataType.Date)] [DisplayName("Spent On")] public DateTime SpentOn { get; set; } But whenever I call Mod...

HTML input readonly security risk?

Is it safe to rely on the data of a html input field set to readonly? What is the purpose of a readonly field? I know the disabled fields are not pushed to $_POST whereas readonly are? Essentially what I want is a dynamic value in my form that is unchangeable to the user. Would it be more appropriate to place this in session or w...

validate int which exceeds PHP_INT_MAX value (2147483647) in zend framework

Any workaround to validate an int field which exceeds PHP_INT_MAX (2147483647 on 32 bit) value? The code I am using in Zend framework is: 'int_input' => array( 'allowEmpty' => true, 'Zend_Validate_Int', array('Zend_Validate_Between',0,4000000000), 'message' => 'Int must be between 1 and 4,000,000,000.' ...

Need to Save HTML markup from a form element

I want to save html markup in my database for a field from an ASP.Net MVC2 application. Upon reading I found that using the [ValidateInput(false)] attribute lets you do that. But it is not working for me. The data comes from the extjs htmleditor form element. Anyone has any ideas? Is there something else I need to do? Any setting in w...

How to prevent entry of HTML into ASP.NET Web form text box

Hello, I have several text boxes in an ASP.NET Web Form. I want to ensure that users are not entering HTML into those text boxes. However, I'm not sure how to prevent HTML from being entered. Because of this, I decided that I want to only allow alphanumeric characters, spaces, exclamation point, sharp sign, dollar signs, percentage sign...

How to validate ID number in asp.net?

Hi, I am new at this so be easy on me... :) I need to validate if a the ID number that the user typed in my site is a valid ID. How do I check it? Do I need to use RegularExpressionValidator? More over, I also need to validate the credit card number, I found a few RegularExpressions for that in the net but each one is different ...

Input-validation based on entire content of JTextField, not just the last typed character

Hello, Is there a way to validate text in a JTextField while you type, based on what you already typed in that field? Should I create a keyEventListener of some sort, or is there a way to override the insertString method to let it do that. I prefer the latter, but it only gives you control over the last character that was typed, not the...

Using stringstream and an int variable in C++ to verify that input is an int

void get_english_input() { string input = " "; stringstream my_string(input); int ft; double in; while(true) { cout << "Enter an integer value of feet." << endl; getline(cin, input); my_string << input; if(my_string >> ft) break; cout << "Invalid input! Please t...