Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Oct 2004 09:19:48 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Gert Cuykens <gert.cuykens@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: perl vs php round 1
Message-ID:  <20041026061948.GB2122@gothmog.gr>
In-Reply-To: <ef60af09041025230216ad5a31@mail.gmail.com>
References:  <ef60af09041025221855f37ea5@mail.gmail.com> <20041026150629.6295505a@bofh.spyderweb.com.au> <ef60af09041025230216ad5a31@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2004-10-26 08:02, Gert Cuykens <gert.cuykens@gmail.com> wrote:
> i want to learn something that is capable to run applications on the
> web but is totally separated from the html meaning i HATE doing this
>
> hello.php
>
> code
> 110101110101010111101010
> code
> html
> he look at me
> html
> code
> 1010101011010101010101
> code
> html
> he look at me
> html
>
> i want to do this
>
> hello.class
> code
> 10101010101111001110101111111
> code
>
> hello.html
> html
> look at me
> html
>
> And i would defenatly want something with classes

This can be done just as easily with mod_perl as with php.  It all depends on
the level of abstraction that you choose to write your HTML pages in.

You can write PHP code like this:

	<html>
	  <head>
	  <title><?php connect_to_database; grab title; print title; ?></title>
	  </head>
	  <body <?php grab body style; print style; ?>>
	    <?php ugly long loop that prints some data
		  mixed with a lot of HTML code and php escapes; ?>
	  </body>
	</html>

or use your own templates for the pages you want created, and write one-liners
like the ones below:

	<?php titlepage(params); ?>
	<?php articlepage(params); ?>
	<?php feedbackpage(params); ?>

and encapsulate things in larger, logical units within the xxxpage()
collection of functions, possibly using classes if you like doing so ;-)

It's all a matter of programming style and spending the time necessary to
design your sites infrastructure, if you ask me.  I've used php for the
samples above, but mod_perl can be used too.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041026061948.GB2122>