...

View Full Version : link display in php



simjay
02-16-2006, 04:27 AM
Hi im making an email form in php,

I am having problems with adding a link to the
$message can you see where im goin wrong.


$message = "A comment has been added to <a href='http://www.site.com/view.php?forum_id=$forum_id'>$forum_name</a>";

Thanks

vinyl-junkie
02-16-2006, 05:41 AM
Your code looks fine. Are you getting an error or what?

simjay
02-16-2006, 05:46 AM
Its not showing it as a link, its showing it as text

vinyl-junkie
02-16-2006, 05:53 AM
I took your code and just made up some values for those variables and ran it on my server. Everything looked fine.

What values are you using for $forum_id and $forum_name?

simjay
02-16-2006, 05:55 AM
I think it must be somthing to do with it being a email, becuse i the emails are sent in text form, not html

vinyl-junkie
02-16-2006, 06:03 AM
You can't have links in plain text email. You'll have to set it up as HTML email if you want the links to look ok and work as hyperlinks.

simjay
02-16-2006, 06:07 AM
what would be the best way to do it automaticaly?

vinyl-junkie
02-16-2006, 02:19 PM
The easiest way to understand HTML email, in my opinion, is to find an HTML mail message in your InBox and view the message source to see how it's put together. For a detailed tutorial on how to setup an HTML email script, I'd recommend that you read the PHPMailer tutorial (http://www.phpfreaks.com/tutorials/130/0.php).

Hope this helps.

degsy
02-16-2006, 02:58 PM
http://uk.php.net/function.mail
There is a basic example there for sending HTML email.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum