Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 915 results for
sanitize
- Page 1
Sanitize PHP user input strings
Programming
Web Development
2 Years Ago
by Dani
…destroy your database! Therefore, you always want to
sanitize
user input into the format you are expecting.… Dani's string"; // It's important to
sanitize
the string before using it in a query! $string…amp;amp; echo htmlspecialchars($string); In conclusion, *always*
sanitize
any variable where you don't have 1000% control …
Sanitize PHP hidden form values
Programming
Web Development
14 Years Ago
by davidjennings
… all, I am new to PHP Do I need to
sanitize
hidden data values in a form before carrying out the…=$_POST['category_id']; $make=$_POST['make']; Also do I need to
sanitize
the query also $result = mysql_query("SELECT * FROM products WHERE…
Re: Sanitize PHP hidden form values
Programming
Web Development
14 Years Ago
by cwarn23
In future please use code tags as this is not your first post. Also the following code should do the trick: [CODE=php]$category_id=mysql_real_escape_string(stripslashes($_POST['category_id'])); $make=mysql_real_escape_string(stripslashes($_POST['make'])); $result = mysql_query("SELECT * FROM products WHERE products_make ='$make'") or …
Re: Sanitize PHP hidden form values
Programming
Web Development
14 Years Ago
by davidjennings
Hi Thanks for the information working fine Thanks for the heads up on the [code] **** [/code] rule and in the future I will add it to any further posts. You mentioned my previous post which is not resolved, any ideas for a solution. Thanks again David [QUOTE=cwarn23;983359]In future please use code tags as this is not your first…
Re: Sanitize PHP hidden form values
Programming
Web Development
14 Years Ago
by cwarn23
[QUOTE]You mentioned my previous post which is not resolved, any ideas for a solution.[/QUOTE]What's the problem or is this solved?
Re: Sanitize PHP hidden form values
Programming
Web Development
14 Years Ago
by davidjennings
Hi This thread is solved and I will mark it accordingly But do you have time to look at my previous thread [url]www.daniweb.co./forums/thread222004.html[/url] Thanks in advance. David
Re: Best practices for sanitize POST parameters
Programming
Web Development
5 Years Ago
by rproffitt
Keeping in mind this is about POST and not SQL, http://php.net/manual/en/filter.filters.
sanitize
.php does seem like a good thing. Other sanitizers at http://php.net/manual/en/filter.filters.
sanitize
.php might be used depending on the need.
Re: Best practices for sanitize POST parameters
Programming
Web Development
5 Years Ago
by alan.davies
… specfic types then you can 'filter' to either validate or
sanitize
. You can also cast to specific types, trim etc. Use…
Re: Best practices for sanitize POST parameters
Programming
Web Development
5 Years Ago
by jkon
Don't
sanitize
, in that way. ALWAYS use PREPARED STATEMENTS (sorry for my caps … but yes I am yelling). A logical confirmation is almost always required (both front-end and back-end). eg. Is this string an integer is it in a valid currency format , is it a valid phone etc . That could be done with a simple String Utils class.
Sanitize HTMLString
Programming
Web Development
11 Years Ago
by Troy III
# This is a simple HTML String Sanitizing tool. # ## It allows a highly rich,- but safe - html content input to be published on your pages. ## **The script code is very light and to some degree customizable.** * This function takes care of blacklisted tags, which are the first to be discarded without further processing. * Otherwise, it checks *…
Re: Sanitize HTMLString
Programming
Web Development
11 Years Ago
by Taywin
Nice snippet. One note for practicality, doing white-list sanitization is better than black-list when it comes down to security. In other words, reject any thing if found any value that is not in expected values rather than attempt to remove unwanted values which may or may not be foreseen. It is less confusing and more intuitive.
Re: Sanitize HTMLString
Programming
Web Development
11 Years Ago
by Troy III
Hi Taywin, thanks for your suggestion. I think there was a reason behind this decision... Its about freedom -------------------- And freedom is about more choices, more opportunities, more solutions and so forth. To my humble opinion -there are always more good people, than bad. Henceforth, contrary to the widespread policy/opinion that treats …
added numeric validation to mysl_real_escape_string function; IS IT OK??
Programming
Web Development
13 Years Ago
by websurfer
… all! <?php // ORIGINAL CODE $_POST=
sanitize
($_POST); $_GET=
sanitize
($_GET); $_COOKIE=
sanitize
($_COOKIE); $_REQUEST=
sanitize
($_REQUEST); function
sanitize
($input){ if(is_array($input)){ foreach($input…
While loop not outputting data from database..
Programming
Web Development
6 Years Ago
by WebDevGuy32145
… ((isset($_POST['confirm']) && $_POST['confirm'] != '')?
sanitize
($_POST['confirm']):$User['password']); $permissions = ((isset($_POST['permissions']) …&& $_POST['permissions'] != '')?
sanitize
($_POST['permissions']):$User['permissions']); } if ($_POST) { $emailQuery = $…
Re: While loop not outputting data from database..
Programming
Web Development
6 Years Ago
by cereal
… an array: $permissions = ((isset($_POST['permissions']) && $_POST['permissions'] != '')?
sanitize
($_POST['permissions']):$User['permissions']); you can hardcode the options in…
login credentials not correct
Programming
Web Development
13 Years Ago
by lovell_82
… ) { $ret_str = mysql_real_escape_string( $str ); } else { $ret_str = addslashes( $str ); } return $ret_str; } /*
Sanitize
() function removes any potential threat from the data submitted. Prevents…is true, newline chracters are removed from the input. */ function
Sanitize
($str,$remove_nl=true) { $str = $this->StripSlashes($str);…
Template engine for Codeigniter 3 with built-in HTML sanitizer
Programming
Web Development
1 Year Ago
by Dani
…tutorial](https://www.daniweb.com/programming/web-development/tutorials/537376/
sanitize
-php-user-input-strings) about how important it is …a database query, but it's also important to
sanitize
user input being displayed to the end-user to generate…know beyond a reasonable doubt that there is nothing to
sanitize
, so I want to save it from being passed…
Who knows little about design patterns ?
Programming
Web Development
10 Years Ago
by Clanstrom
…this class helps check somethings in a string. class
Sanitize
{ public $errors = []; function checkEmail($email){ …I probably would do... $
Sanitize
= new
Sanitize
(); $checkEmail = $
Sanitize
->checkEmail($_POST['email']); if(!$
Sanitize
->checkErrors){ $QueryClass …
web throwing wierd errors at me please help
Programming
Web Development
11 Years Ago
by GraficRegret
…false; } function user_id_from_userName($userName) { $userName =
sanitize
($userName); return(mysql_result(mysql_query("SELECT `user_id` …password) { $user_id = user_id_from_userName($userName); $userName =
sanitize
($userName); $password = SHA1($password); return (mysql_result(…
[L3] Automatic Filtering Input in Laravel 3.*
Programming
Web Development
11 Years Ago
by cereal
…, in this example I'm using `filter_var_array()`: public static function
sanitize
($array) { $result = filter_var_array($array, FILTER_SANITIZE_STRING); return $result … $array * @param array $input * @return array */ public static function
sanitize
($array, $input = array()) { $purifier = IoC::resolve('HTMLPurifier'); $array…
Login and Registration Error
Programming
Databases
10 Years Ago
by wareez
… server include('SQLConfig.php'); //Function to
sanitize
values received from the form. Prevents SQL injection //
Sanitize
the POST values $a = $_POST['username… server include('SQLConfig.php'); //Function to
sanitize
values received from the form. Prevents SQL injection //
Sanitize
the POST values $a = $_POST['username…
Logic issue in php
Programming
Web Development
6 Years Ago
by WebDevGuy32145
…submmited if (isset($_POST['add_submit'])) { $brand =
sanitize
(mysqli_real_escape_string($db, $_POST['brand'])); // check if brand …']; }else { if (isset($_POST['brand'])) { $brand_value =
sanitize
($_POST['brand']); } } ?> <label for="brand…
URL gets changed upon submit when editing
Programming
Web Development
6 Years Ago
by WebDevGuy32145
…$errors = array(); $delete_id = (int)$_GET['delete']; $delete_id =
sanitize
($delete_id); $dsql = "DELETE FROM categories WHERE id = '$delete_id… && !empty($_POST)) { $post_parent =
sanitize
($_POST['parent']); $category =
sanitize
($_POST['category']); $sqlform = "SELECT * FROM…
Activate wordpress plugin function using radio from admin page
Programming
6 Years Ago
by idaryl
…Option name array( $this, '
sanitize
' ) //
Sanitize
); add_settings_section( 'setting_section_id', // …setting-admin', 'setting_section_id' ); } /** *
Sanitize
each setting field as needed * * @…
Re: getting undefines function error even though function is defined
Programming
Web Development
11 Years Ago
by diafol
… : false; } function user_id_from_username($username) { $username =
sanitize
($username); $query = mysql_query("SELECT `user_id` FROM `… $password) { $user_id = user_id_from_username($username); $username =
sanitize
($username); $password = sha1($password); $query = mysql_query("…
Re: Chat script Not working with mysqli
Community Center
3 Years Ago
by Sananil
…chatHistory'][$chat['from']]; } $chat['username'] =
sanitize
( $chat['username']); $chat['message'] =
sanitize
($chat['message']); if($chat['photo1']=='') { if…echo "1"; exit(0); } function
sanitize
($text) { $text = htmlspecialchars($text, ENT_QUOTES); $…
Re: Chat script Not working with mysqli
Community Center
3 Years Ago
by Sananil
…chatHistory'][$chat['from']]; } $chat['username'] =
sanitize
( $chat['username']); $chat['message'] =
sanitize
($chat['message']); if($chat['photo1']=='') { if…echo "1"; exit(0); } function
sanitize
($text) { $text = htmlspecialchars($text, ENT_QUOTES); $…
Re: Chat script Not working with mysqli
Community Center
3 Years Ago
by soniyabis
…chatHistory'][$chat['from']]; } $chat['username'] =
sanitize
( $chat['username']); $chat['message'] =
sanitize
($chat['message']); if($chat['photo1']=='') { if…echo "1"; exit(0); } function
sanitize
($text) { $text = htmlspecialchars($text, ENT_QUOTES); $…
MD5 password PHP/mySQL
Programming
Web Development
13 Years Ago
by pjh1985
…password']); $cpassword = clean($_POST['cpassword']); //Function to
sanitize
values received from the form. Prevents SQL injection function …get_magic_quotes_gpc()) { $str = stripslashes($str); } return mysql_real_escape_string($str); } //
Sanitize
the POST values $fname = clean($_POST['fname']); $lname = clean($_POST…
getting undefines function error even though function is defined
Programming
Web Development
11 Years Ago
by GraficRegret
…true : false; } function user_id_from_username($username) { $username =
sanitize
($username); $query = mysql_query("SELECT `user_id` FROM `users`…, $password) { $user_id = user_id_from_username($username); $username =
sanitize
($username); $password = sha1($password); $query = mysql_query("…
1
2
3
16
Next
Last
Search
Search
Forum Categories
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
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