Writing a HMTL file in Delphi code

Am I correct in saying this: -
I see PHP is all about reading a script in a HMTL file and that is included with the HTML text, when PHP? is reached the PHP interrupter takes over in reading the file and installs the text results of the interrupted PHP into the file in process of being read as HMTL. So this is a totally script based system that is delayed by reading text scripts that is not great for heavy traffic use and should any one get into these pages do a lot of page damage.

is this correct
JAVA - creates the entire HMTL script file/page using Java code and both these options can install database access to records into the HMTL.

If you can build HMTL files in Java you must be able to build HMTL files in Delphi some how is what I’m thinking.
May be directly sending into a web server and reading returning text from a web server? or make a TStringList and install line after line of HTML in TStringList then send it off to the HTML server.

Am I talking sensible stuff and what is the better way to look at this - what tools are going to work in Delphi for both Linux and Windows? what videos or helps are out there. When I go to Delphi File>New>customize>Delphi>Web
I have XML, Jason, Web server application options.
Web server application options last time in Delphi 7 created a DLL - So why a *.DLL and not an application.

Can some one correct my head please

PHP is a general-purpose scripting language. You can create .PHP files which can then be directly served up by a properly configured web server or executed as CLI scripts using things like php.exe -f nameofphpfile.php

It can be embedded in HTML with the tags as you mention or it can be executed directly and then generate any kind of output to the STDOUT or stream - or indeed do anything else just like any other programming language. PHP drives some extremely large websites which have many millions of hits per day and your assertion that “is not great for heavy traffic use and should any one get into these pages do a lot of page damage” (which has some interesting grammar there I do not fully understand) is not correct.

Java - the programming language, doesn’t work the way you say either (I am assuming you’re not conflating Java and JavaScript which are two quite different things). Java is also a general-purpose programming language, like Delphi, C#, and similar. It typically creates Java executables which are then either fully compiled or are tokenized and then interpreted at runtime - most similar to how C# and even how Python works, except Java is not a text-based script unlike Python.

I think your understanding of “build HTML files in Java” is not correct. I think you’re confusing the fact the Java runtime can execute the apps on the customer’s machine directly, or via a web browser, often using something like an app server similar to Apache Tomcat.

It might be best for you to read a little more about web technologies and PHP, Java, and so on before coming back with a more clear question.

I suspect what you’re trying to ask is “how can I write a Delphi program and have it work in a web browser” - if this is the case then try Googling:

  • Intraweb
  • UniGUI
  • TMS WEB Core
  • Web Broker
  • RAD Server
  • RAD Studio WebStencils

and see if any of these are the kind of thing you have in mind.

PHP is a server side scripting technology that as you said pre-processes HTML files for PHP and executes that PHP code before the HTML is served to the client. I wouldn’t say PHP isn’t great for heavy traffic, it’s a time tested technology that still runs a large part of the web.

Server side Java (as opposed to Javascript) can be used in a number of ways in a website. As you said it could be used to generate the entire HTML file with Java code, but that’s quite a brute force approach. More commonly Java would not be used to generate the HTML, but to do the backend logic/database code. The actual HTML files would be written using a frontend web framework that used a mix of HTML and JavaScript.

These days JavaScript has expanded from being used just on the client side to the server side as well, so you may well see JavaScript being used on the server instead of Java.

As Ian said there are a number of options for doing web development with Delphi and for the most part they’re adequate for the task.

If you just need a small to medium sized website that allows some basic data entry to an underlying database and you’re not too concerned about how it looks, you can achieve that pretty easily with Delphi.

If you want a website that looks and feels like most big public websites, you could use Delphi but it may not be the best choice.

If you can provide a brief generic description of the website you want to build, we can recommend an appropriate web technology for you. No need to tell us what the website will do, if you provide brief answers to the following that will probably be enough:

  • Approximately how many “pages”?
  • Will it be used by the general public, corporate customers or corporate internal employees?
  • How many concurrent users are you likely to have?
  • Does it show data from a database?
  • Does it edit data from a database?
  • Does it need to reuse any existing Delphi code? Is it a web version of an existing Delphi program?
  • How important is the look and feel of the website?
  • Do you need to interface with any external systems e.g. payment gateways, external APIs?
  • Do you have a budget for a third party web dev tool or are you looking for a no-cost option?
1 Like

To round things up a little is to say
If you want a professional looking web site that stands out to users - It needs CSS, JavaScript, Dotnet to give the details to the reader.
You can use anything you like as far as languages go to deliver from a database into the above at the server level.

I understand a *.DLL delivers the web page items to the screen in all the browsers.
Why has their not been a bowser that combines all the different languages as one standard language - other than that can block innervation and development.
As on thing that stands out with web pages is the wide range of sizes of screens they present on.

1 Like