Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Strip Slashes?

  1. #1
    New to the CF scene
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Strip Slashes?

    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!

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •