Reply
PHP Security Question
Old 05-10-2008, 11:42 PM PHP Security Question
Average Talker

Posts: 15
PHP Code:
Code:
for(i=0;i<count($_POST);i++){ 
strip_tags($_POST[i]); 
}
anyone got a good fix for this or maybe a pre-existince script i could use?

for security reasons, of course, I'm trying to strip tags from all of the post data preferably withOUT having to assign the $_POST[] variables to other variables before hand
nitinleew is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-11-2008, 12:15 AM Re: PHP Security Question
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 837
Name: Jeremy Miller
Location: Reno, NV
That doesn't take into account variable without a number as the index. This will be better:

PHP Code:
if (is_array($_POST)) {
  foreach (
$_POST as $key=>$value) {
    
$_POST[$key] = strip_tags($value);
  }

__________________
Jeremy Miller - TeraTask Technologies, LLC
Content Farmer - Automated Posting for Content & Blog Sites
JeremyMiller is online now
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Reply     « Reply to PHP Security Question
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.79408 seconds with 13 queries