View Full Version : Strip Slashes?

02-11-2003, 03:17 AM

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
<img src="<%ecard_image_name%>" border="1">
<p class="TextBlackBold12">

I'm using a pre-written script found at:

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 = 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!

02-11-2003, 05:07 AM

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum