Jump to content

PHP clean $_POST


cordoprod

Recommended Posts

Hi..

I have a wysiwyg editor (tinymce) and use mysql database.

What i want to do is: when the user submits the form i want to kind of clean the $_POST.

 

I do not want following:

- javascript (of any kind)

- flash (but, from allowed pages)

 

I am trying but can't really figure out what to do

Link to comment
https://forums.phpfreaks.com/topic/144205-php-clean-_post/
Share on other sites

Let say you have these form inputs...

 

$_POST['input_one'];
$_POST['input_two'];
$_POST['input_three'];

 

We all know the SUPER GLOBALS are saturated with all incoming variables that are set by the METHOD they are coming in as "GET, POST". So we create a filter to handle those variables. We do not handle all the "GET, POST" variables, only the ones we are expecting because we do not want to open the door for XXS actions that can incur if we process all incoming variables. So the logical approach is to perform a cleaning action on only the variables that are expected, which keeps your application safe and the SUPER GLOBALS will only be filled with variables that are expected, and they will be CAST & CLEANED by their TYPE.

 

Now I understand you only want to get something done, but why not spend a little time and write something that does this for all your scripts, because it should always be done at script initialization! If you want a basic example, tell me I and I give you one.

 

 

Link to comment
https://forums.phpfreaks.com/topic/144205-php-clean-_post/#findComment-756763
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.