Skip to main content
Code Review

Return to Question

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Which one is the best function or what is bad in these functions? How do I add a filter to validate the link? [1]: http://stackoverflow.com/questions/34514116/stop-prevent-xss-attacks https://stackoverflow.com/questions/34514116/stop-prevent-xss-attacks

Which one is the best function or what is bad in these functions? How do I add a filter to validate the link? [1]: http://stackoverflow.com/questions/34514116/stop-prevent-xss-attacks

Which one is the best function or what is bad in these functions? How do I add a filter to validate the link? [1]: https://stackoverflow.com/questions/34514116/stop-prevent-xss-attacks

Fixed spelling, improved title, added tag.
Source Link
Mast
  • 13.8k
  • 12
  • 57
  • 127

serverside save Save user input in dbserver-side database

I have created a site for practisepractice and iI have already asked a question ON [STack Owerflow][1]on [Stack Overflow][1] about XSS.

These are two phpPHP functions iI created that sentizesanitize/validate user input and after passing the the userinputuser input in these funtion ifunction I save the user input in my server(storgestorage).

This is my second php funtionsPHP function:

whichWhich one is the best function or what is bad in funtions these functions? howHow do iI add filtera filter to validate the link? [1]: http://stackoverflow.com/questions/34514116/stop-prevent-xss-attacks

serverside save user input in db

I have created a site for practise and i have already asked a question ON [STack Owerflow][1] about XSS.

These are two php functions i created that sentize/validate user input and after passing the the userinput in these funtion i save the user input in my server(storge).

This is my second php funtions

which one is the best function or what is bad in funtions ? how do i add filter to validate link? [1]: http://stackoverflow.com/questions/34514116/stop-prevent-xss-attacks

Save user input in server-side database

I have created a site for practice and I have already asked a question on [Stack Overflow][1] about XSS.

These are two PHP functions I created that sanitize/validate user input and after passing the the user input in these function I save the user input in my server(storage).

This is my second PHP function:

Which one is the best function or what is bad in these functions? How do I add a filter to validate the link? [1]: http://stackoverflow.com/questions/34514116/stop-prevent-xss-attacks

Source Link

serverside save user input in db

I have created a site for practise and i have already asked a question ON [STack Owerflow][1] about XSS.

Someone tell me to show your php functions on this site that i created using filter_Var

These are two php functions i created that sentize/validate user input and after passing the the userinput in these funtion i save the user input in my server(storge).

function Meg_selfvalidator_html($data){//Validator
 if(is_array ($data)){
 
 $arrayLen = count($data);
 
 for($i=0;$i<$arrayLen;$i++){
 $data[$i] = trim($data[$i]);
 $data[$i] = stripslashes($data[$i]);
 $data[$i] = htmlentities($data[$i], ENT_QUOTES);
 $data[$i] = filter_var($data[$i], FILTER_SANITIZE_STRIPPED, FILTER_FLAG_STRIP_HIGH );
 $data[$i] = filter_var($data[$i], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
 $data[$i] = filter_var($data[$i], FILTER_SANITIZE_STRIPPED, FILTER_SANITIZE_STRING);
 
 }
 return $data;
 
 }else{
 $data= trim($data);
 $data= htmlentities($data, ENT_QUOTES);
 $data = stripslashes($data);
 $secured_output = filter_var($data, FILTER_SANITIZE_STRIPPED, FILTER_FLAG_STRIP_HIGH );
 $secured_output = filter_var($secured_output, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH );
 $secured_output = filter_var($secured_output, FILTER_SANITIZE_STRIPPED, FILTER_SANITIZE_STRING);
 return $secured_output;
 }
 
}

This is my second php funtions

function selfValidator($data) {//Validator
 if(is_array ($data)){
 
 $arrayLen = count($data);
 
 for($i=0;$i<$arrayLen;$i++){
 $data[$i] = trim($data[$i]);
 $data[$i] = stripslashes($data[$i]);
 $data[$i] = strip_tags($data[$i]);
 $data[$i] = htmlspecialchars($data[$i]);
 $data[$i] = filter_var($data[$i], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
 }
 return $data;
 
 }else{
 $data = trim($data);
 $data = stripslashes($data);
 $data = strip_tags($data);
 $data = htmlspecialchars($data);
 return $data;
 }
}

which one is the best function or what is bad in funtions ? how do i add filter to validate link ? [1]: http://stackoverflow.com/questions/34514116/stop-prevent-xss-attacks

lang-php

AltStyle によって変換されたページ (->オリジナル) /