1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

(php) Mailform and HTML tags through flash

Discussion in 'PHP' started by fastforward, May 7, 2006.

  1. #1
    Hi

    So I'm currently trying to create a mailform which supports HTML tags.

    This is how it works:

    In my flashfile (.swf) the user is filling out some textfields. Then this data is sent out from flash to a .php file, which sends the email.

    However, when I receive the mail, all links in the text disappears. So I look in the raw mail (I'm using Gmail), and each time there is a quotationmark ", a backslash \, is inserted before.

    Now, I'm pretty sure it's due to the PHP code, is there someway to embed some of the text?

    My PHP code:

    <?php 
    
    // name sent from Flash 
    $navn = utf8_decode($_POST['navn']); 
    
    // e-mail sent from Flash 
    $email = utf8_decode($_POST['email']); 
    
    // message sent from Flash 
    $kommentar = nl2br(utf8_decode($_POST['kommentar'])); 
    
    // e-mails receiver 
    $modtager = "mortenkh@gmail.com"; 
    
    // e-mails topic 
    $emne = "E-mail sendt via Flash formmail"; 
    
    // e-mails sender 
    $afsender = $navn . "<" . $email . ">"; 
    
    // send e-mail 
    mail($modtager, $emne, $kommentar, "From: $afsender\r\nContent-type: text/html; charset=iso-8859-1"); 
    
    ?>
    PHP:
    The raw mail data:

    Hi,<br />
    <br />
    How are you doing?  -check out this <a href=\"http://www.macro-design.org\">link</a>.
    Code (markup):
    What I wrote in my mailform:
    SEMrush
    Hi,
    
    How are you doing? -check out this <a href="http://www.macro-design.org">link</a>.
    Code (markup):
    Have a nice day :)
     
    fastforward, May 7, 2006 IP
    SEMrush