[GLLUG] Syntax checking

Mike Szumlinski szumlins@msu.edu
Wed, 20 Mar 2002 19:26:32 -0500


Oops..I'm doing it all in php...here is a little snippet of what I'm
currently doing to print a journal of sorts.

<snippet>

        while ($myrow = mysql_fetch_row($result))
        {
        
        printf("<i>$myrow[2]</i><p>\n");
        printf("$myrow[0]<br>\n");
        printf("<font size='-1'>Posted by $myrow[1]</font></p>");

        }

</snippet>

$myrow[0] is a text field for a journal entry, so it definitely has the
potential to have parentheses (as well as quotation marks and anything else
bad to the printf() statement).  Is there a way to auto convert any "bad"
characters to whatever their code equivalent is (ie &nbsp = space) in html
so it doesn't break the page?

-Mike


On 3/20/02 5:12 PM, "Dpk" <dpk@egr.msu.edu> wrote:

> printf in C or perl or something else?  Can you provide a code snippet
> (grabbing and printing) as I am not quite sure the source of your
> problem.

-=--===---===---===---===-=-
|Mike Szumlinski           |
|Michigan State University |
-=--===---===---===---===-=-
"We are what we repeatedly do. Excellence, then, is not an act, but a habit"

                                                                 -Aristotle