I’m looping through a form post to set a variable for each field and clean them. Pretty sure the below is functioning as I wish.
[php]<?php
foreach($_POST as $key=>$value){
$value=htmlentities(stripslashes(strip_tags($value)));
$$key = trim($value);
}
?>[/php]
Later down the page I need to display a specific field. I could just display the post variable:
echo $_POST[“admin_phone”];
But I want to display the cleaned version I set in the foreach loop. Either my loop isn’t working, or I’m an idiot and can’t find the correct syntax to make that happen.
Be kind - Coldfusion is my main language and some PHP stuff just befuddles my mind so far!