Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
It's less that the PHP implementation ignores other lines, it simply outputs them. Any templating language ever does the same thing. – delnan Sep 2 '12 at 13:22
@delnan I think it is the matter of webserver proxy how to connect to the script gateway. – All Sep 2 '12 at 14:18
There are also Plugins such as Silverlight. – NoChance Sep 2 '12 at 18:48
up vote 1 down vote accepted

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.

share|improve this answer

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.

share|improve this answer
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. – Avner Shahar-Kashtan Sep 2 '12 at 13:24
@Avner Shahar-Kashtan: you're right. I always forget this one. Thanks. – MainMa Sep 2 '12 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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