Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 58 results for
sanitization
- Page 1
Sanitize PHP user input strings
Programming
Web Development
2 Years Ago
by Dani
…tags.php) php function. PHP additionally has
sanitization
functions to ensure a string is properly formatted… email address.'; } By using `filter_var()` with
sanitization
and verification flags, you can ensure that a …string into MySQL, then MySQL has a
sanitization
function that automatically escapes potentially dangerous characters from…
problem with combining asp and html file
Programming
Web Development
12 Years Ago
by MayaPawar
…;a href="../asset-recovery/data-
sanitization
.html" target="_parent" >Data
Sanitization
</a></li>…
[L3] Automatic Filtering Input in Laravel 3.*
Programming
Web Development
10 Years Ago
by cereal
… to session or to cache it without bothering anymore with
sanitization
. #Note 2# This snippet will not work in **Laravel 4…
Change button from Submit to Submitting
Programming
Web Development
9 Years Ago
by Bensirpent07
…']; $contact = $_POST['contact1']; //sanitizing email $email = filter_var($email, FILTER_SANITIZE_EMAIL); //After
sanitization
Validation is performed if (filter_var($email, FILTER_VALIDATE_EMAIL)) { if (!preg_match("…
In other news, Dell brings Greek malware into view
Hardware and Software
Information Security
8 Years Ago
by happygeek
… like this one it is worth to consider applying data
sanitization
techniques to remove any harmful content from images downloaded from…
Android Native - How to use TypeConverter for Room
Programming
Mobile Development
2 Years Ago
by dimitrilc
… as a serialized BLOB or a JSON string, with proper
sanitization
. ## Pre-made TypeConverters ## You might have noticed that I have…
Template engine for Codeigniter 3 with built-in HTML sanitizer
Programming
Web Development
1 Year Ago
by Dani
… I want to save it from being passed into the
sanitization
functions for efficiency sake. The code for the `deep_clone()` function…
User form input sanitization
Programming
Web Development
12 Years Ago
by teedoff
I have two inputs for users to enter, what should always be a nueric string. This string gets processed and some mathmatical cals done to them, then the results are returned to the same page via cf div and bind attribute. Everything works if only numbers are entered. I have assumed a cfqueryparam with a reg ex could be used, but not having much …
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by teedoff
I should have added the error is a CFML construct error, just not sure what the error is.
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by arrgh
What is the error message?
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by teedoff
> Error retrieving markup for element dynaDiv : Invalid CFML construct found on line 3 at column 73. [Enable debugging by adding 'cfdebug' to your URL parameters to see more information] Is the error I'm getting.
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by arrgh
*Enable debugging by adding 'cfdebug' to your URL parameters to see more information* And when you did what it said, what was the real error message? Note, ajax debugging has to be enabled in the CF Admin too. > `<cfset actualVolts = url.socketVoltage>` A couple observations - you're only validating the 1st parameter, not all of them.…
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by teedoff
Well I only added the first to test. When I added the first, it seems a syntax error is present because the color of all following code changed, which usually indicates a missing quote or comma or something. I'll check the ajaz debug info this evening when I get home. Thanks for the help.
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by arrgh
Oh well you are missing a closing single quote. I thought it was just a pasting error. `<cfset lampVolts = REReplaceNoCase(url.lampVoltage, '[^a-z0-9]', '(missing here), 'all')>` But you should use the debugger too. That's where all the juicy error messages are when using ajax features ;-)
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by teedoff
Ok that missing single quote fixes that problem. Maybe I should have explained my desired results better lol. What I'm wanting to do is strip anything BUT numbers from the input fields. Then if a user types in 120v, or 120volts, all characters except the numbers are stripped out before processing. Hope that makes better sense.
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by arrgh
Yeah, that's what I figured. But you'll still need additional validation to handle common math errors (divide by zero, value is completely non-numeric, etc..)
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by teedoff
This seems to work fine: > <cfset lampVolts = REReplaceNoCase (url.lampVoltage, '[^0-9]', '', 'all')> > <cfset actualVolts = REReplaceNoCase (url.socketVoltage, '[^0-9]', '', 'all')> > <!--- Set Constants For Calculations ---> > <cfset lumens = 27500> > <cfset life = 500> >…
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by arrgh
> Not sure what you mean about divide by zero values. You're using the variables in a division operation. Dividing by zero throws an error. If the final value is 0 the code will blow up. Likewise, if the result of your regex is an empty string, like if the user entered nothing or all letters.
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by teedoff
lol Never thought someone might enter a 0 as a value. hmm ok need to do something different then. Thanks!
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by teedoff
Well I'm trying to find some help on this, but everything I find discusses SQL division by zero errors. Not sure that's what I need since this is just a user input variable. Know any good links for this? Thanks.
Re: User form input sanitization
Programming
Web Development
12 Years Ago
by arrgh
Handling is basically the same in any language. Use an if/else to do the division when the value isn't 0. Otherwise, do something else like return 0.
Re: User form input sanitization
Programming
Web Development
11 Years Ago
by simplico
Ever thought to use <cfinput validate="numeric" ...>?
Re: User form input sanitization
Programming
Web Development
11 Years Ago
by arrgh
That would certainly improve the UX. But like always, you've still got to back it up with server side validation.
Re: Tell Me About The Likes Of ChatGPT
Community Center
Geeks' Lounge
11 Months Ago
by borobhaisab
… that. Here's the updated PHP code with validation and
sanitization
for the user input: Copy ```` <?php // Set … Me: You edit the php code to add validation and
sanitization
in the user input. PHP Coder: Sure, I can … that. Here's the updated PHP code with validation and
sanitization
for the user input: ```` <?php // Set your …
Re: Replace Chars in String Problem
Programming
Web Development
15 Years Ago
by ~s.o.s~
… could certainly be used as an effective one-way
sanitization
technique
Sanitization
by converting special characters to their numeric equivalents rather than…
Re: My hosting site was hacked and a landing page form is hacked
Programming
Web Development
10 Months Ago
by Alisha_8
… actions, or hidden form fields. 2. Implement input validation and
sanitization
: Make sure the form has proper input validation and…
sanitization
mechanisms in place. Validate and sanitize all user-submitted data …
Re: Replace Chars in String Problem
Programming
Web Development
15 Years Ago
by MattEvans
…, this could certainly be used as an effective one-way
sanitization
technique -- coupled with wrapping the processed input in a pair…
Re: Replace Chars in String Problem
Programming
Web Development
15 Years Ago
by MattEvans
… pretty much forgot this is the Javascript forum, and any
sanitization
of that type should ( must! ) be done at the server…
Re: Don't wast your time with multiple $_GETS, $_POSTS, $_REQUEST, $rows
Programming
Web Development
13 Years Ago
by ShawnCplus
… (email, string, int, etc.), it has built in validation and
sanitization
based on what filter you used. As for "I…
Re: Inserting into mysql db
Programming
Web Development
13 Years Ago
by simasj
So what is the problem? Data is not inserted or you php code gives error? P.S. Your code is VERY insecure! Please do at least any input data validation and
sanitization
.
1
2
Next
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC