Basic Website Languages

Basic Website Languages Explained.
HTML
PHP

ASP
FLASH
MYSQL

What is HTML?

HTML is a language for describing web pages.

HTML stands for Hyper Text Mark-up Language
HTML is not a programming language; it is a mark-up language
A mark-up language is a set of mark-up tags
HTML uses mark-up tags to describe web pages

HTML Tags
HTML mark-up tags are usually called HTML tags

HTML tags are keywords surrounded by angle brackets like <html>
HTML tags normally come in pairs like <b> and </b>
The first tag in a pair is the start tag, the second tag is the end tag
Start and end tags are also called opening tags and closing tags

HTML Documents = Web Pages
HTML documents describe web pages
HTML documents contain HTML tags and plain text
HTML documents are also called web pages
The purpose of a web browser (like Internet Explorer or Firefox) is to read HTML documents and display them as web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page:

Example

<html>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>

The text between <html> and </html> describes the web page
The text between <body> and </body> is the visible page content
The text between <h1> and </h1> is displayed as a heading
The text between <p> and </p> is displayed as a paragraph
What is PHP?

PHP: Hypertext Pre-processor is a widely used, general-purpose scripting language that was originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document. As a general-purpose programming language, PHP code is processed by an interpreter application in command-line mode performing desired operating system operations and producing program output on its standard output channel. It may also function as a graphical application. PHP is available as a processor for most modern web servers and as a standalone interpreter on most operating systems and computing platforms

PHP is a server-side; HTML embedded scripting language used to create dynamic Web pages. Much of its syntax is borrowed from C, Java and Perl with some unique features thrown in. The goal of the language is to allow Web developers to write dynamically generated pages quickly.

In an HTML page, PHP code is enclosed within special PHP tags. When a visitor opens the page, the server processes the PHP code and then sends the output (not the PHP code itself) to the visitor s browser. It means that, unlike JavaScript, you don t have to worry that someone can steal your PHP script.

PHP offers excellent connectivity to many databases including MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, and Generic ODBC. The popular PHP-MySQL combination (both are open-source products) is available on almost every UNIX host. Being web-oriented, PHP also contains all the functions to do things on the Internet - connecting to remote servers, checking email via POP3 or IMAP, url encoding, setting cookies, redirecting, etc.

Basic Syntax

File name:
You should save your file with the extension .php (earlier versions used the extensions .php3 and .phtml).
Comments:
// this comment extends to the end of the line.
/* this is
a multi-line
Comment */
Escaping from HTML:
A PHP code block starts with "<?php" and ends with "?>". A PHP code block can be placed anywhere in the HTML document.
Instruction separation:
Each separate instruction must end with a semicolon. The PHP closing tag (?>) also implies the end of the instruction.

Here's a small PHP example:

<html>
<head><title>Example</title></head>
<body>
<h1><?php echo "Hello World"; ?></h1>
<?php
$txt = "This is my first PHP script";
/* this line creates the variable $txt and gives it the initial value. Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive. */

echo $txt;
?>
</body>
</html>

PHP is geared towards the Web

While many programming languages can be used to build Web applications, PHP is one of the few languages specifically designed for the Web. To this end, it includes a lot of useful Web-related features out of the box, such as:

Easy ways to read and handle Web forms and cookies

Functions for creating and manipulating graphics

The ability to talk to popular databases such as MySQL, and functions for working with HTML.

You can mix PHP

What Is CSS?

What can I do with CSS?

CSS is a style language that defines layout of HTML documents.
CSS is an acronym for Cascading Style Sheets

CSS was first developed in 1997, as a way for Web developers to define the look and feel of their Web pages. It was intended to allow developers to separate content from design so that HTML could perform more of the function that it was originally based      on - the mark-up of content, without worry about the design and layout.

CSS didn’t gain in popularity until around 2000, when Web browsers began using more than the basic font and color aspects of CSS. And now, all modern browsers support all of CSS Level 1, most of CSS Level 2, and some aspects of CSS Level 3.

HTML can be (mis-)used to add layout to websites. But CSS offers more options and is more accurate and sophisticated. CSS is supported by all browsers today.

What is the difference between CSS and HTML?

HTML is used to structure content. CSS is used for formatting structured content.

A style sheet can, and should be, completely separate from your HTML documents. When you have mastered CSS and HTML, you will be able to separate your web site's design and formatting (CSS) from the content (HTML).

CSS Selector

CSS selectors are the heart and soul of CSS. They define which HTML elements you are going to be manipulating with CSS code and you should have a solid understanding of them when you are finished with this tutorial. Luckily for you, they are pretty simple to comprehend!

CSS Selector: Where It Fits In

In a typical CSS statement you have the following:
SELECTOR {PROPERTY: VALUE}
"Property" is the CSS element you wish to manipulate and "VALUE" represents the value of the specified property.

CSS Selector Name

The selector name creates a direct relationship with the HTML tag you want to edit. If you wanted to change the way a paragraph tag behaved, the CSS code would look like:
p { PROPERTY: VALUE }
The above example is a template that you can use whenever you are manipulating the paragraph HTML element. In the next lessons, we will not only teach where to place you’re CSS, but why and where you should use CSS as well.

Internal CSS

Cascading Style Sheets come in three flavours: internal, external, and inline. We will cover internal and external, as they are the only flavours a designer should utilize. In this lesson, we cover the basics of the easier type, internal. When using internal CSS, you must add a new tag, <style>, inside the <head> tag. The HTML code below contains an example of <style> s usage.

CSS Code:

<html>
<head>
<style type="text/css">
</style>
</head>
<body>
<p>Your page's content!</p>
</body>
</html>

This doesn't actually do anything visually. The code style tag just tells the browser that we will be defining some CSS to be used on this page.

Creating Internal CSS Code

CSS code is not written the same way as HTML code is. This makes sense because CSS is not HTML, but rather a way of manipulating existing HTML. Below is an example of some simple, yet fully functional, CSS code.

CSS Code:

Copy this code to your notebook or favourite html editor and name is tutorial.html on your desktop or where ever you have your files. Open it up afterwards by double clicking it.

<html>
<head>
<style type="text/css">

p {color: white; }
body {background-color: black; }
</style>
</head>
<body>
<p>your first css, notice the white on black background!</p>
</body>
</html>

What Is Java?

Java is a programming language and computing platform first released by Sun Microsystems in 1995. It is the underlying technology that powers state-of-the-art programs including utilities, games, and business applications. Java runs on more than 850 million personal computers worldwide, and on billions of devices worldwide, including mobile and TV devices.

You need Java, or you would not see some of the stuff on this page.

Java has evolved to be the most predominant and popular general purpose programming language of the current age. Java is a simple, portable, distributed, robust, secure, dynamic, architecture neutral, object oriented programming language. It was developed by Sun Microsystems. This technology allows the software designed and developed once for an idealized ‘virtual machine’ and run on various computing platforms.

Java plays a significant role in the corporate world. Companies of all sizes are using Java as the main programming language to develop various applications/projects worldwide. It has found its use in various sectors including banking, insurance, retail, media, education, manufacturing and so on.  E-commerce, Gaming, Mobile, Embedded, Media and many more types of applications are being developed using Java. Organizations are developing mission critical applications using Java technologies.  This necessitates the corporations to hire highly skilled java developers. On the other hand it opens the doors for many opportunities for java developers. There is significant demand for java developers with sound technical skills. Now Colleges and Universities all over the world are using it in their introduction courses as well as their junior and senior software engineering courses.

Java can also be used to create small programs, known as "applets," to be embedded in web pages. For instance, a web page using Java could contain an interactive weather map, a live display of subway trains, or a video game, without the need for the web server to do all of the work. Unlike normal software such as .EXE files, these "applets" cannot access or delete your personal files unless they ask for and are given express permission to do so. In the real world, users hardly ever give permission for this, so applets generally don t ask.

Java is a high level programming language and it is used to develop the robust application. Java application program is platform independent and can be run on any operating System.

Want to try a Java Script?

Go to this link and download the Java Platform JDK

Pick your operating system

Java JDK

Writing Hello World program is very simple. To write the Hello world program you need simple text editor like note pad and jdk must be installing in your machine for compiling and running. Hello world program is the first step of java programming language. Be careful when you write the java code in your text pad because java is a case sensitive programming language.


Write the following code into your note pad to run the Hello World program

 class HelloWorld {
       public static void main(String[] args){
       System.out.println("Hello World!");
     }
}


Save the file and please remember the location where you save your file. In this example we have saved the file in the "C:\javatutorial\example" directory. The file name should be matching the class name and to save the file give the .java extension. e.g.  HelloWorld.java

Now open the command prompt to compile the HelloWorld.java program. Go to the directory where you have saved the file (in our case C:\javatutorial\example>) and issue the following command to compile the program:

C:\javatutorial\example>javac HelloWorld.java
javac is a compiler in the java Language. Java compiler changes the programming language into machinery language. So that the java virtual can understand it. Once the compilation is successful a new file will be created with the name HelloWorld.class. To run the program issue the following command on command prompt:

C:\javatutorial\example>java HelloWorld

You will see the following result on the command prompt.


Hello World!

Here is the screen shot of the above steps:









What Is ASP

ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. The ASP.NET SOAP extension framework allows ASP.NET components to process SOAP messages.

An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are executed on the server.

What Can You Do with Active Server Pages?

There are many things you can do with Active Server Pages.

You can display date, time, and other information in different ways.

You can make a survey form and ask people who visit your site to fill it out, send emails, save the information to a file, etc

You can have a database which people can access via the web. People can get information from the database as well as update or insert information into it.

You can password-protect certain sections of your site, and make sure that only authorized users can see that information.

The possibilities are virtually endless. Most widget that you see on WebPages nowadays can be easily done using ASP.

What Do Server-Side Scripts Look Like?

Server-side scripts typically start with <% and end with %>. The <% is called an opening tag, and the %> is called a closing tag. In between these tags are the server-side scripts. You can insert server-side scripts anywhere in your webpage - even inside HTML tags.

<HTML>
<HEAD>
<TITLE>Hello, World !</TITLE>
</HEAD>
<BODY>
<%
Response.Write “Hello, World!”
%>
</BODY>
</HTML>

This statement displays the string “Hello, World!” on the webpage

So In A Nutshell...

What is ASP?

ASP stands for Active Server Pages
ASP is a Microsoft Technology
ASP is a program that runs inside IIS
IIS stands for Internet Information Services
IIS comes as a free component with Windows 2000
IIS is also a part of the Windows NT 4.0 Option Pack
The Option Pack can be downloaded from Microsoft
PWS is a smaller - but fully functional - version of IIS
PWS can be found on your Windows 95/98 CD

ASP Compatibility

To run IIS you must have Windows NT 4.0 or later
To run PWS you must have Windows 95 or later
ChiliASP is a technology that runs ASP without Windows OS
InstantASP is another technology that runs ASP without Windows

What is an ASP File?

An ASP file is just the same as an HTML file
An ASP file can contain text, HTML, XML, and scripts
Scripts in an ASP file are executed on the server
An ASP file has the file extension ".asp"

How Does ASP Differ from HTML?

When a browser requests an HTML file, the server returns the file
When a browser requests an ASP file, IIS passes the request to the ASP engine. The ASP engine reads the ASP file, line by line, and executes the scripts in the file. Finally, the ASP file is returned to the browser as plain HTML

What can ASP do for you?

Dynamically edit, change, or add any content of a Web page
Respond to user queries or data submitted from HTML forms
Access any data or databases and return the results to a browser
Customize a Web page to make it more useful for individual users
The advantages of using ASP instead of CGI and Perl, are those of simplicity and speed provide security - since ASP code cannot be viewed from the browser
Clever ASP programming can minimize the network traffic

What Is Flash?

Similar to Java, Flash ( formally Macromedia Flash) is another technology that allows animations, interactive forms, games and other jazzed-up features to be embedded in web pages. Macromedia Flash Player is a well-known and trustworthy plug-in that users should feel comfortable installing. In fact, Flash is the most commonly installed plug-in on the web, more common than QuickTime, RealPlayer or Java. The Flash plug-in can be found on Macromedia s website.

Flash is a tool for creating interactive and animated Web sites! It is a cool way to spruce up your website top stand out.

Flash is a multimedia graphics program especially for use on the Web

Flash enables you to create interactive "movies" on the Web

Flash uses vector graphics, which means that the graphics can be scaled to any size without losing clarity/quality

Flash does not require programming skills and is easy to learn

Flash vs. Animated Images and Java Applets

Animated images and Java applets are often used to create dynamic effects on Web pages.

The advantages of Flash are:

Flash loads much faster than animated images

Flash allows interactivity, animated images do not

Flash does not require programming skills, java applets do

Who can Create Flash Movies and Scripts?

Anyone, it is a easy to use program. You can get Adobe Flash Lite, or Flash CS3 Pro. They will even give you a 30 day trial.

What Is MYSQL?

MySQL is a freely available open source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL).

SQL is the most popular language for adding, accessing and managing content in a database. It is most noted for its quick processing, proven reliability, ease and flexibility of use. MySQL is an essential part of almost every open source PHP application. Good examples for PHP/MySQL-based scripts are phpBB, osCommerce, and Joomla.

MySQL is a database system used on the web. Basically, a MySQL database allows you to create a relational database structure on a web-server somewhere in order to store data or automate procedures. If you think of it in comparison to Microsoft Access, MySQL is what holds all of your tables, PHP acts as your queries (among other things), and your forms are basically web pages with fields in them. With all of this combined, you can create truly spectacular projects on the web.

MySQL is also open source in that it’s free and falls under the GNU General Public License (GPL). Chances are, if you are getting your own web-page or already have one - your host supports MySQL and PHP. They are generally associated with (though not limited to) Unix/Linux based servers. If by chance you are considering getting your own page and want MySQL and PHP support, check out Dreamhost - I’ve been using them for years and they absolutely can’t be beat.

Interacting with a MySQL database is a little weird as you don’t have the tried and true WYSIWYG interface that something as easy as Microsoft Access affords. When creating tables, you’ll either have to create them by using SQL Statements, or by using another open-source tool available online called PHPMyAdmin. PHPMyAdmin gives you an easy-to-use interface that allows you to create tables and run queries by filling in a little bit of information and then having the tables created for you. This is good if you’re either lazy, or don’t feel like bothering with big and complicated SQL Statements.

In comparing MySQL to Access you’re going to have a truckload of differences. While MySQL isn’t exactly tough to tackle (once the tables are created - you’re pretty much done with it), it’s capabilities extend far beyond that of Microsoft Access when dealing with speed and reliability. It’s simply a better system

What is a Database?

A database is a structure that comes in two flavours: a flat database and a relational database. A relational database is much more oriented to the human mind and is often preferred over the other flat database that is just stored on hard drives like a text file. MySQL is a relational database.

In a relational structured database there are tables that store data. The columns define which kinds of information will be stored in the table. An individual column must be created for each type of data you wish to store (i.e. Age, Weight, Height).

On the other hand, a row contains the actual values for these specified columns. Each row will have 1 value for each and every column. For example a table with columns (Name, Age, Weight-lbs) could have a row with the values (Steve, 40, 195). If all this relational database talk is too confusing, don't despair. We will talk about and show a few examples in the coming lessons.

Example...

Create a mysql database, tables and insert data

If you want to create a database and set up tables for the same use the following two sql commands:

 CREATE DATABASE - create the database

 CREATE TABLE - create the table

 INSERT - To add/insert data to table

CREATE DATABASE creates a database with the given name. To use this statement, you need the CREATE privilege for the database

CREATE TABLE creates a table with the given name. You must have the CREATE privilege for the table.

INSERT inserts new rows into an existing table.

Procedure for creating a database and a sample table

Login as the mysql root user to create database: CMD Line.

$ mysql -u root -p

Output

mysql>

Add a database called books

mysql> CREATE DATABASE books;

Now database is created. Use a database with use command:

mysql> USE books;

Now create a table called authors with name, email and id:

mysql> CREATE TABLE authors (id INT, name VARCHAR(20), email VARCHAR(20));

Display your table name just created:

mysql> SHOW TABLES;

Output:
+------------------------+
| Tables_in_books |
+------------------------+
| authors                  |
+------------------------+
1 row in set (0.00 sec)

Now add a data / row to table books using INSERT statement:

mysql> INSERT INTO authors (id,name,email) VALUES(1,"Bob","bob@gmail.com");

Output:

Query OK, 1 row affected (0.00 sec)

Add few more rows:

mysql> INSERT INTO authors (id,name,email) VALUES(2,"Steve","steveshowto@hotmail.com");
INSERT INTO authors (id,name,email) VALUES(3,"Tom","tom@yahoo.com");

Now display all rows:


 

No comments:

Post a Comment