...

View Full Version : Strip Slashes?



Filmscape
02-11-2003, 03:17 AM
Hi,

I'm using a HTML template that combines some include tags <%....%> to pull in specific content. When this content is captured from a form and stored in variables it includes 'slashes' before ( " ) and ( ' ).

I know there is a stripslash() function in PHP but I have little experience with it. Can anyone enlighten me on how to format the following tags within HTML to omit these slashes when encountered:

<span class="TextBlackBold18">NED E-Card from
<%ecard_sender_name%>
</span><br>
<br>
<img src="<%ecard_image_name%>" border="1">
<p class="TextBlackBold12">
<%ecard_message%>
</p>

I'm using a pre-written script found at:
http://www.ibps-friedrichs.de/_down...ecards_1-01.zip

Another snippet below:

function parse_ecard_template($ecard,$ecard_data) {
$ecard_data = preg_replace ("/<%ecard_sender_email%>/",
$ecard["email_sender"], $ecard_data);
$ecard_data = preg_replace ("/<%ecard_sender_name%>/",
$ecard["name_sender"], $ecard_data);
$ecard_data = preg_replace ("/<%ecard_image_name%>/", $ecard["image_name"],
$ecard_data);
$ecard_data = preg_replace ("/<%ecard_message%>/", preg_replace ("/\r?\n/",
"<BR>\n", htmlspecialchars($ecard["message"])), $ecard_data);
$ecard_data = preg_replace ("/<%ecard_reciepient_email%>/",
$ecard["email_recepient"], $ecard_data);
$ecard_data = preg_replace ("/<%ecard_reciepient_name%>/",
$ecard["name_recepient"], $ecard_data);
return $ecard_data;
}

Many thanks!

Spookster
02-11-2003, 05:07 AM
http://codingforums.com/showthread.php?s=&threadid=2459



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum