View Full Version : strip_tags not working

07-07-2007, 01:12 AM
ive got this section of code and strip_tags wont work. help?


$insertUserID = trim($_POST['fb_sig_user']);
$checkPrayers = trim(strip_tags($_POST['insertPrayers']));
if($checkPrayers=="" || checkPrayers==" "){
$insertPrayers = "This user has not set any prayer requests.";
$insertPrayers = addslashes(preg_replace("/\n[^\w]*\n/","\n",$checkPrayers));
if(isset($_POST['fb_sig_user']) && isset($_POST['fb_sig_session_key']) && isset($_POST['fb_sig_time']) && isset($_POST['fb_sig']) && isset($_POST['fb_sig_api_key']) && isset($user) && $_POST['fb_sig_user']==$user) {

$insert=mysql_query("INSERT INTO fbpl_udata_dev (id,prayers) VALUES ('$insertUserID', '$insertPrayers')
ON DUPLICATE KEY UPDATE prayers='$insertPrayers';")
or die ("Could not update prayer list: " . mysql_error());

description of whats goin on...
makes sure prayers is set, or if it isnt then write the no prayers set thing... but its supposed to take out tags right there. then it makes sure that there are no multiple line breaks, only 1 should be there... then checks a bunch of variables, makes sure they are set so it can put in things only when through the form rather than going to just the page and setting a blank row, then inserts data into mysql. the prob is the strip_tags wont work, and i dont see why...

07-07-2007, 05:21 AM
can anybody help?