Most of scripting languages (like Pythong, Perl, etc) generates the whole HTMLfile. However, PHP code can be embedded within html codes. PHP will process only code between <?php ?> tags and ignore other lines.

What other scripting languages are available with possibility to be embedded within HTML?

  • 2
    It's less that the PHP implementation ignores other lines, it simply outputs them. Any templating language ever does the same thing.
    – user7043
    Sep 2, 2012 at 13:22
  • @delnan I think it is the matter of webserver proxy how to connect to the script gateway.
    – Googlebot
    Sep 2, 2012 at 14:18
  • There are also Plugins such as Silverlight.
    – NoChance
    Sep 2, 2012 at 18:48

3 Answers 3


You can mix even perl (with eperl), but it's generally a bad practice.

You should think through the following:

  • Is your data to be indexed by Google?
  • Is this a webpage or an application?

If it's an application, which won't be indexed by Google, grab JavaScript, CoffeeScript, Dart or Flash, and write a standard MVC application, with your server providing the backend in form of JSON-based services. It's just way more easier to think this way and still deal with application-level complexity.

If this has to be indexed by google, and/or it's a webpage, then build a WebMVC webpage, with templates, in Spring (java), Ruby on Rails (ruby), Django (python), Symfony (php), Catalyst Framework (perl), whatever. It's easier to accommodate data changes usually with such.

Both of these solution scale considerably.

Remember, every application started small.


As delnan noted in his comment, any templating language would do that.

If your question is rather about what are the languages where you can mix both this language and the HTML, here's some which come into mind:

  • C# and VB.NET (through ASP.NET or ASP.NET MVC, given that those are not languages, but frameworks).

    Note that while you can embed C#/VB.NET source code into templates (.aspx files or Razor templates), there is a clear separation between application source code - the one which is compiled during the build, and the code within the templates - the one which is published in plain text and is compiled only by the server when needed.

  • Java (through JSP).

  • VBScript and JScript (through ASP).

  • JavaScript.

  • ASP isn't a language, it's a framework, very much like ASP.NET WebForms (the framework commonly known as ASP.NET). Unlike ASP.NET, which uses C# or VB.NET as its server-side scripting language, classic ASP used VBScript or JScript as a scripting language. Sep 2, 2012 at 13:24
  • @Avner Shahar-Kashtan: you're right. I always forget this one. Thanks. Sep 2, 2012 at 13:27

Pretty much every modern language has one or more server page language. PHP is just the only language who's primary reason for existence is for writing server pages. Most modern languages will also have more than one template language.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.