On 04 Feb 23:19, Srdjan Todorovic wrote:
On 4 February 2010 23:07, Chris G cl@isbd.net wrote:
On Thu, Feb 04, 2010 at 09:36:56PM +0000, Srdjan Todorovic wrote:
The <?php and <? tags are seen by the web server, passed to the PHP module/library/whatever, which is then what processes the PHP code, does business logic/db or file access/etc and then (often) generates HTML which is passed to the webserver and then sent to the client browser. I think.
Yes, so is the <?php tag just a bodge that only works with, for example, apache2, or what is it? Are there other tags like this possible, e.g. <?perl or <?python ? If not, why not? (I just like logic to my computer programming!)
I would think that <?php and <? is a PHP specific element. You could check by perhaps looking at the PHP source code or PHP developer docs.
Something somewhere would have defined that as the delimiter for the start of PHP code.
I don't think there is a <?python directive. But if you could change Apache source code and if Python could act as CGI, then I can't see why it won't be possible to have <?python. Of course you'd then have to make sure your python is well formatted because the silly language does not use ; and {} ;)
Correct, there's no <?python directive, because when you tell things that they should be processed by mod_python it interprets the code as *python*, not a bastard mix of html and random scripting.
Also, just because something has syntax that doesn't use ; and {} doesn't mean that it's a silly language, and I'd much rather pick up python code a lot of the time because it's correctly indented, and therefore a hell of a lot easier to read.
I can only assume that you're a fan of write-once languages :P