klinmy Posted March 11, 2006 Share Posted March 11, 2006 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> </textarea></center>[/code]but it just printed out the total code of <a href= > instead of appearing as a link.thanks Quote Link to comment Share on other sites More sharing options...
AV1611 Posted March 11, 2006 Share Posted March 11, 2006 are you using a textarea as part of a form? If so, no... butif you just want it in a textarea, use an IFrame instead... visually, you can give the same effect... Quote Link to comment Share on other sites More sharing options...
klinmy Posted March 11, 2006 Author Share Posted March 11, 2006 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 Quote Link to comment Share on other sites More sharing options...
AV1611 Posted March 11, 2006 Share Posted March 11, 2006 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... Quote Link to comment Share on other sites More sharing options...
klinmy Posted March 11, 2006 Author Share Posted March 11, 2006 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> </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] Quote Link to comment Share on other sites More sharing options...
klinmy Posted March 11, 2006 Author Share Posted March 11, 2006 i've found a better easier way of doing tht :Dthx anyway Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted March 11, 2006 Share Posted March 11, 2006 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 believeSo 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.