Re: Web Interface and index.pl separated?!?



Nikos <hackeras@xxxxxxxxx> wrote:
> Inside my webpage index.pl i ahve the Perl code and the interface of the
> page: Do you think that i must separate the page's interface in a file
> by itself and then in another index.pl make calculations and stuff with it:

It is probably easiest to work with the both in the same file.

> i have i as follows to generate graphics. here is a asmall part:

> print start_form(-action=>"show.pl");
> print table( {-border=>1, -width=>"60%", -align=>"center",
> -style=>"border: ridge magenta; color: lime; font-family: Times;
> font-size: 18", -background=>"../data/images/swirl.jpg"},
> Tr( {-align=>'center'}, td( "??? ?? ???? ???????" ),
> td( textfield( 'onoma' ))),
> Tr( {-align=>'center'}, td( "???? ????? ? ????? ??? ??? ??? ???????
> \"????? ????? ?????? ??????? ??\"?"
> ), td( textarea( -name=>'sxolio', -rows=>5, -columns=>30 ))),
> Tr( {-align=>'center'}, td( "???????? ???? ??? ??? ???? ?? ????? ???
> ???????? ????????? ??? ??????????
> ????????
> ??? ??????? ??????? ???? ?????? ???
> ????????? ??????? (?? ?????? ?????
> :-)" ), td( textarea( -name=>'symvan', -rows=>7, -columns=>30 ))),
> Tr( {-align=>'center'}, td( "???? ????? ?? e-mail ????" ),
> td( textfield( 'email' ))),
> Tr( {-align=>'center'}, td( submit( '???????? ???? ??? ???????'
> )), td( submit( '????????' ))));
> print end_form(), br(), br();
>
> also inside index.pl a have javascript embedded in a here document.
>
> Is this wrong approach?

No... it is whatever you find most convenient.

> For example how could i rewrite the above script?
> The funny stuff is actually Greek! :-)

One way would be to do the calculations required and then print all the
HTML with any results inserted as a 'here' document (or several to keep
the relevant calculations close to the output templates).

But then I have never really seen much point in adding an extra layer of
complexity by using functions in creating HTML.

Axel



.



Relevant Pages

  • Re: spreadsheet to HTML
    ... is have it total itself in an HTML page. ... rather than just have them show up as a static display. ... You can then either submit the form to a server, ... or use javascript to perform the calculations within the web page. ...
    (comp.infosystems.www.authoring.html)
  • Re: Real-time form-field updating
    ... > I have a form that is using HTML and PHP to make calculations for an ... > order form. ...
    (comp.lang.javascript)
  • Re: Web Interface and index.pl separated?!?
    ... "Do you think that i must separate the page's interface in a file by itself ... business layer i.e. your calculations seperate. ... Prev by Date: ...
    (comp.lang.perl.misc)
  • Re: Nitrox - MOD and EAD Calculator
    ... a lot easier than the Great Circle distance calculations... ... you get away with stuff that more compliant browsers won't ... your Javascript routines... ... On of the main advantages of doing it as HTML based with Javascript is that ...
    (rec.scuba.equipment)
  • Button for calculations
    ... I have a data access page that I am wanting to add to my website. ... On this page I want to put a button that when pushed will do some small calculations and then post these calculations into a series of text boxes. ... I setup a test html document so that I can try to figure out how to do this and I can't get it to put anything in the text box. ... alert(myString + quotient); ...
    (microsoft.public.publisher.webdesign)