Velocd
10-27-2002, 09:03 PM
I'm creating a hack that during one of the processes it takes HTML code from a template and sends it to a specified user as a personal message.
The only problem is the HTML code is not parsed.
Say my template called priv_forwardpost contains:
<a href="http://www.lycos.com">hello</a>
Well, in the PM to that user, when he reads it will show exactly as:
<a href="http://www.lycos.com">hello</a>
With not links. I have tried using htmlspecialchars() or bbcodeparse() or addslashes(), just to see if they would do anything put they don't :(
Basically here is the small part of my code where the problem exists:
eval("\$message = \"".gettemplate("priv_forwardpost",1,0)."\";");
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title ,message,dateline,messageread,folderid) VALUES (NULL,$pm_userid,$pm_userid,$bbuserinfo[userid],'".addslashes(htmlspecialchars($pm_title))."','".addslashes($message)."',".time().",0,0)");
So how can I get it when the user views the PM, the $message is parsed and HTML shows?
Thanks if you can help.
The only problem is the HTML code is not parsed.
Say my template called priv_forwardpost contains:
<a href="http://www.lycos.com">hello</a>
Well, in the PM to that user, when he reads it will show exactly as:
<a href="http://www.lycos.com">hello</a>
With not links. I have tried using htmlspecialchars() or bbcodeparse() or addslashes(), just to see if they would do anything put they don't :(
Basically here is the small part of my code where the problem exists:
eval("\$message = \"".gettemplate("priv_forwardpost",1,0)."\";");
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title ,message,dateline,messageread,folderid) VALUES (NULL,$pm_userid,$pm_userid,$bbuserinfo[userid],'".addslashes(htmlspecialchars($pm_title))."','".addslashes($message)."',".time().",0,0)");
So how can I get it when the user views the PM, the $message is parsed and HTML shows?
Thanks if you can help.