Re: DHTML and CGIs in Euphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message

Thanks Lucius. In my next cgi I will try this.
Your ideas are very intersting. This method is much
more easy to work with DHTML than printf and %s.

Is there more people in the list working with cgi scripts in euphoria ?

Rubens


At 20:25 3/10/2003, you wrote:
>
>
>I hope all of this helps.
>
>The strategy you are using is a bad one.
>1. You have to keep your data aligned.
>     Let us assume the page looks like this.
>     template =3D "<h1>%s</h1>Hello %s"
>     Then you change it to this.
>     template =3D "<h1>%s</h1><h2>%s</h2>Hello %s"
>     You have to make sure to apply all the data in the right order.
>2. Redundant use. You have to supply the same data repeatedly.
>     Hello %s, It is nice know that your name is %s.
>     %s, we were wondering if your name has always been %s.
>3. The problem you mentioned.  % being in the actual page.
>     Not really solvable.  Choose another character or combination
>     of characters OR escape it like you are doing.
>
>Now lets solve the rest of these.
>1. Have a replace_all() function.
>         -- replace_all() created [2002/07/26 00:30:18] while in IRC
>         -- http://eulogs.unkmar.com/logs/Eu.20020726.log.html#l60
>         function replace_all(sequence string, sequence to_replace, sequence=
>
>replace_with)
>           integer m, lt
>           sequence result
>           lt =3D length(to_replace)
>           result =3D ""
>           m =3D match(to_replace, string)
>           while m do
>             result &=3D string[1..m-1] & replace_with
>             string =3D string[m+lt..length(string)]
>             m =3D match(to_replace, string)
>           end while
>           return result & string
>         end function
>         puts(1, replace_all("Lucius Lamar Hilley III", "L", "LL"))
>2. Use named tokens.
>     template =3D "<h1>~HEADER~</h1>Hello ~NAME~ Double tilde is actual ~~"
>     template =3D replace_all(template, "~~", {1000})
>     for A =3D 1 to length(form_names) do
>       template =3D replace_all(template, form_names[A], form_values[A])
>     end for
>     template =3D replace_all(template, {1000}, "~")
>
>         Lucius L. Hilley III - Unkmar
>         I'm good, not god.
>
>----- Original Message -----=20
>From: <rml at rubis.trix.net>
>To: "EUforum" <EUforum at topica.com>
>Sent: Friday, October 03, 2003 10:09 AM
>Subject: DHTML and CGIs in Euphoria
>
>
>Hi Euphorians;
>
>I=B4m working with some CGIs in Euphoria for creating dinamic html pages,
>based on data sent in by the client and retrived from an edb database.
>
>For this purpose, I=B4m using the "%s" option inserted in some places of th=
>e
>html code:
>
>For example:
>
>text=3D{"Yellow","Banana"}
>printf(1,<h1>%s</h1><h2>%s</h2>,text)
>
>
>This works great, BUT, there is a big problem.
>A lot of instructions in HTML use the % simbol. So, if I create a HTML page=
>
>using tables for example, I have to take a lot of care with the command
>width=3D"xx%" and change all of them to width=3D"xx%%".
>
>My question is :  Is there any other way in euphoria for create dinamic
>HTML pages ? Is the strategy I=B4m using for this a good one ? Any
>suggestions about creating cgi scripts in euphoria are welcome !
>
>Thanks
>
>Rubens
>
>
>
>TOPICA - Start your own email discussion group. FREE!

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu