Jump to content


Photo

link in textarea


  • Please log in to reply
6 replies to this topic

#1 klinmy

klinmy
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 11 March 2006 - 07:58 AM

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

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

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

thanks

#2 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 11 March 2006 - 02:19 PM

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...

#3 klinmy

klinmy
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 11 March 2006 - 02:31 PM

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

#4 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 11 March 2006 - 02:35 PM

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...

#5 klinmy

klinmy
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 11 March 2006 - 02:50 PM

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.

<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!";
    }    
    
}


#6 klinmy

klinmy
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 11 March 2006 - 04:38 PM

i've found a better easier way of doing tht :D

thx anyway


#7 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 11 March 2006 - 05:04 PM

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:
Content-Type: text/html; charset=iso-8859-1

As you are using phpMailer you need add this:
$mail->IsHTML(true);
after
$mail->WordWrap = 50;
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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users