mhonarc-users

Re: MHonArc and PHP (for <TITLE> Generation)

2000-02-03 21:37:47
On Thu, 3 Feb 2000, John Hogan wrote:

I'd use the 'AddSlashes()' function before the variable is passed to the 
<title> tag

(Thanks also to Nathaniel for his suggestion)

John - thanks for the suggestion, however, how can PHP add the slashes in?

Example:

In my MHonArc .rc file, I have:

-=-
<MsgPgBegin>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML//EN">
<?php $$title = "$SUBJECTNA$ - ML Archive"; ?>
<?php $$slash_title = addslashes("$title");?>
<?php include("head.include") ?>
</MsgPgBegin>
-=-

Now, the problem lies in that when PHP sees that $title variable in the
generated message file, it barfs since it can't parse it.  I can't stick
the addslashes function in before that line, since I would be modifying a
variable that hadn't been defined yet (and would then croke with a
parsing error on the following line).

What I would suggest is that MHonArc have the ability to take the
"$SUBJECTNA$" variable, and either escape the (") or better yet, convert
them to &quot; , similar to PHP's htmlspecialchars function, which can be
found at:

http://www.php.net/manual/function.htmlspecialchars.php3

If there already is such a function in MHonArc, let me know.  I really
would like to have the Subject of a message to be a part of the title of
the generated HTML that MHonArc  produces.  (helps with searching thru the
Mail Archives with a search engine, etc.)

Thanks! - Peter

---
Peter Losher                                  
<Peter(_dot_)Losher(_at_)nominum(_dot_)com>     
Systems Admin. - Nominum, Inc.              PGP key available on request




<Prev in Thread] Current Thread [Next in Thread>