How to write false $_REQUEST, please help

by 3 replies
4
This is if statement $_REQUEST if the language translated


i need to set the opposite, if the language not translated, what its looks like, please help





which one is correct? or no one of them



#programming #$request #false #write
    • [1] reply
    • This way you make your site XSS friendly. Filter out bad characters before checking



      = trim(strip_tags());
  • [DELETED]
    • [1] reply
    • That should output errors.

      Do not use the code Vanfenix posted.
      Like MoneyMouse said, it is prone to XSS and other potential vulnerabilities.

      But I would extend the security further and use an array of except-able values.
      First clean it with trim and strip_tags like he showed.

      Then

      eg $lang_array = array('English', 'Dutch', 'German', 'etc');

      Then do a check to see it the $_REQUEST is in the array

      if(in_array($_REQUEST['language'], $lang_array)
      {
      //Your code
      }

      This way the code prone will only be run if the value is in your array.

Next Topics on Trending Feed