Re: Little MHonArc patch to help with PHP pages....

1998-04-24 09:21:26
[Note, please use the mhonarc list for mhonarc related questions]

On April 23, 1998 at 22:26, Kyle R VanderBeek wrote:

Just one thing.  I've been using php (, similar to ASP or
SHTML, but cooler) to make my pages prettier and, unfortunately, it also
uses $ for variables.  The RC parser in MHonArc blows up when I try to
include PHP code fragments that include variables as HTML fragments in my
rc file.  For example, I have a little thing called a "theme" that shows
up on my web pages, and something like this:

include "";
$theme = StartPage("Kyle",$HTTP_GET_VARS["theme"]);

is at the top of all my pages.  Your regex for searching for variables
($VarExp = '\$([^\$]*)\$'; in produces an error on this line
when it's used somewhere like IdxPgBegin.  Changing it to this


Solves the problem, and shouldn't break any existing rc files since they
should be using variables/resources without spaces anyhow.  Just a

The regex will break an addition I put into the next release and
potential break the use of user defined variables if a user used
a space in a custom variable name.

A solution is to escape the '$' so MHonArc will not think it is the
start of a resource variable.  This is done by doing "$$".  Taking
the example you provided, it can be redone as follows:

include "";
$$theme = StartPage("Kyle",$$HTTP_GET_VARS["theme"]);


             Earl Hood              | University of California: Irvine
      ehood(_at_)medusa(_dot_)acs(_dot_)uci(_dot_)edu      |      Electronic 
Loiterer | Dabbler of SGML/WWW/Perl/MIME

<Prev in Thread] Current Thread [Next in Thread>
  • Re: Little MHonArc patch to help with PHP pages...., Earl Hood <=