Jump to content

Archived

This topic is now archived and is closed to further replies.

klinmy

link in textarea

Recommended Posts

can i place a link in textarea like what i did below?

[code]  <center><textarea name="Body"  ROWS="10" COLS="100">
this is text area body.

<A HREF = "form.php"><font face="verdana" size="2" > click here </A></FONT>&nbsp;&nbsp;


</textarea></center>[/code]

but it just printed out the total code of <a href= > instead of appearing as a link.

thanks

Share this post


Link to post
Share on other sites
are you using a textarea as part of a form? If so, no... but
if you just want it in a textarea, use an IFrame instead... visually, you can give the same effect...

Share this post


Link to post
Share on other sites
thanks AV1611, but i need to "wrap" the codes in '$body' as that is the info i am going to send out via mail() function, that's why i use textarea.. any better suggestion so that i can do that? (place a link in my mail() $body)

thanks

Share this post


Link to post
Share on other sites
Well, without seeing your code, this come to mind...

place the info in a $STRING, then display is in one place but use it in another...

I'm just guessing, I don't see your code...

Share this post


Link to post
Share on other sites
it's the codes i'm trying on. i need to get the info from previous page and then place it in the textarea as the email body together with a link.

[code]<form name="frm11" form action="" method=post>


  <center><textarea name="Body"  ROWS="10" COLS="100">
  <? include ("".$_SERVER['DOCUMENT_ROOT']."/cuti3/includes/config.php");
$_SESSION['uid'] = $uid;
$_SESSION['pwd'] = $pwd;

$query=mysql_query("SELECT * FROM staff WHERE id='$uid'");

<?php echo $_GET[id] ?> is a <?php echo $_GET[sex] ?>

<A HREF = "form.php"><font face="verdana" size="2" > click here </A></FONT>&nbsp;&nbsp;


</textarea></center>


<?


if(isset($send))
{
        
    require("class.phpmailer.php");
    $mail = new PHPMailer();
    $mail->IsSMTP(); // telling the class to use SMTP
    $mail->Host = "smtp.tm.net.my"; // SMTP server
    $mail->From="user@tm.net.my";
    $mail->FromName = "ky";
    $mail->AddAddress("user@hotmail.com");

    $mail->Subject = "hi";
    $mail->Body = "$Body";
    $mail->WordWrap = 50;

    if(!$mail->Send())
    {
      echo "Message was not sent\n";
      echo "Mailer Error: \n" . $mail->ErrorInfo;
    }
    else
    {
      echo "Message was sent successfully!";
    }    
    
}[/code]

Share this post


Link to post
Share on other sites
You can put tye HTML in the textarea but need to send the email with a HTML header so the email client will parse the HTML and create a link.

The folloowing si what needs to be sent in the header fo the email:
[code]Content-Type: text/html; charset=iso-8859-1[/code]

As you are using phpMailer you need add this:
[code]$mail->IsHTML(true);[/code] after [code]$mail->WordWrap = 50;[/code] i believe

So now when you send your email. Your html should be parse by the email client and so a link should appear where the HTML is.

Read [a href=\"http://phpmailer.sourceforge.net/tutorial.html#4\" target=\"_blank\"]here[/a] for sending HTML mail with phpMailer.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.