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 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2003
    Location
    New York, USA
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Embed a link in Newsletter

    Hello Again All,

    I have a php mailing List script that I want to embed an unsubscribe link into.

    The problem is that the link is not showing up in the news letter but the code is.

    I thought it may have been because it needed stripslashes so I did that.
    Here is the code:
    <td><textarea name="message" cols="40" rows="8" id="textarea" class="box"><?php
    $str = "<a href=\"http://www.mysite.com\">Unsubscribe here</a>";
    echo stripslashes($str);
    ?>
    </textarea></td>

    But this is the result in the newsletter:

    Test 3<a href=\"http://www.mysite.com\">Unsubscribe here</a>

    Any insight as to how I can correct this would be great!

    Thanks
    NYColt

  • #2
    New Coder
    Join Date
    Oct 2003
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    add a second stripslashes
    echo stripslashes(stripslashes($str));
    that should do it...

  • #3
    Regular Coder
    Join Date
    May 2003
    Location
    34° 54' N 82° 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, you don't have to stripslashes twice.
    PHP Code:
    <?php
    echo stripslashes($str);
    ?>
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    SDP, you do for textareas and stuff sometimes, when that stupid magic quotes or whatever it's called is turned on

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    but, for the simple code NYColt is using here, he really shouldn't have to.

    BTW if you're sending the HTML in an email, you shouldn't be echoing it, you should just have it contained in the string you send as the body...

    PHP Code:
    ...
    $body .= '<a href="http://www.mysite.com">Unsubscribe here</a>';
    ...
    fputs ($connect"Subject: $subj\r\n");
    fputs ($connect"MIME-Version: 1.0\r\n");
    fputs ($connect"Content-Type: text/html; charset=us-ascii\r\n");
    fputs ($connect"Content-Transfer-Encoding: 8bit\r\n");
    fputs ($connect"\r\n");
    fputs ($connect"$body\r\n");
    fputs ($connect".\r\nQUIT\r\n\r\n");
    ... 


  •  

    Posting Permissions

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