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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.