Programming.a.baby - (Pmg) Server Script Languages (Hello world body)
By pol1ce
Programming - Article 3
What are
Server Script Languages are Programming languages that work inside a Web Server when a web page is requested, this way, they are very secure since the user cannot see the programming script code behind it, all that he sees is a delivery Html Web Page with some attachments and images.
Some of the famous Server Script Languages:
- Perl (1987) Unix (Cgi) Language
- Asp (1989) MS tech using VBScript or JScript
- Php (1995) Linux (Cgi) Language
- Asp.net (2002) MS tech using C# or Java
Code Sample 1
<html> <body> <div> Hello World </div> </body> </html>
Code Sample 2
<html> <body> <div> <?php echo "Hello World"; ?> </div> </body> </html>
Web Page Output 1
Hello World
How a Server Script Language Works
Imagine that:
- you have a html web page with the name "abc.html"
- lodged in some server named "mywebhost" and that
- you possess a domain called "www.mydomain.com" pointed to your Web Host
When some user in the Internet using a Web Browser like "Internet Explorer, FireFox...etc" writes the following name in the address bar "www.mydomain.com/abc.html" it will reach you page, and since it's only a Html document, the server "mywebhost" will deliver this as it is without any treatment.
But now if your Page is not only a Html document, "abc.pl, abc.asp, abc.php, abc.aspx...etc" if there are some Server-side Scripts that need an "software interpreter application", this will change the way you and your Internet users seeing the web page
Samples
- Take a look on the Code Sample 1 where i made a simple Html web page document
- In the Code Sample 2 i added a small piece of PHP script
When a Internet User write the address "www.mydomain.com/abc.html"
- he will see in the web page exactly what you are seeing in the "Web Page Output 1"
- If the User edit your source code, he will see what is in the "Code Sample 1"
- You and the people with access to your physic web documents are the only that can see the code like it is in the "Code Sample 2"
...
Various Code Samples
In the following Samples you will learn how using different Server Script Languages, you can:
- Declare the Script
- To give a string value to a Variable
- To give a Intact number value to a variable
- Make a comment inside the code "this is a comment"
- To tell the server to write the Variables and some strings
Perl Code Sample (page.pl)
#!/usr/bin/perl $username = "Paul" $age = 35 #This is a Comment! print "content-type: text/html \n\n"; print "Hello, "; print username print " your age is " print age
Asp Code Sample (page.asp)
<%Language = "VBScript"%> <% username = "Paul" age = 35 'This is a comment Response.Write "Hello, " & username & " your age is " & age %>
Php Code Sample (page.php)
<?php $username = "Paul" $age = 35 //This is a comment Echo "Hello, " . $username . " your age is " . $age ?>
Asp.Net Code Sample (page.aspx)
<% username = "Paul" age = 35 %> <%-- This is a Comment lbl3.Text= "Hello, " & username & " your age is " & age --%> <form runat="server"> <h3><asp:label id="lbl3" runat="server" /></h3> </form>
««« My Previous Articles on this Theme
- Programming.a.baby - (Pmg) Browser Script Languages ...
Browser Script Languages are Programming Languages that can work inside or be interpreted by Web Browser. Suppose you are watching a Web Page made only with Html and/or Text, there's nothing happening... - Programming.a.baby - (Pmg) High and Low Level Langua...
The golden question: Why there are so many programming languages? Do we need them? The answer is a big NO, we do not need more than 200 languages Why then, people don't stop to make new languages every...
Comments
No comments yet.