12
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

Embed Size (px)

Citation preview

Page 1: Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

Server- Side technologies

Client-side vs. Server-side scriptsPHP basic

ASP.NET basicColdFusion

Page 2: Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

Client-side scripting vs. Server-side scripting

• Client-side script • Executed by a user’s web browser (client) – a web browser

interprets the code.• Usually based on some kind of user’s actions or events (e.g.

clicking a button)• All the actions are followed without communication with the

server• Examples of client-side scripts: JavaScript, VBScript

• Server-side script • Executed by the web server only, when a user requests a document• Then a document is sent to the user’s computer• The user cannot see the script’s source code• HTML document is produced by a server-side script• Examples of server-side scripts: PHP, ASP, ASP.NET, Cold

Fusion

Page 3: Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

PHP Hypertext Preprocessor (PHP)

• PHP – an open source server-side scripting language for creating dynamic Web pages.

• Executed on a web server• Embedded in HTML pages • Interacts with MySQL database management

system

Page 4: Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

PHP syntax (basic)• Creating a PHP script:

• PHP script can be inserted anywhere on the page• PHP file extension must be defined as .php• The PHP should be inserted between <?php and ?> tags

» Example: <?php echo “Hello, World”; ?>» Where echo is a command that writes the output on the user’s

monitor

• PHP variables should be declared using $ symbol» Example: <?php

$message = “Hello, World”; echo $message; ?>

• PHP comments are the same as in JavaScript:// comments for one line of code/* comments for multiple lines of code */

Page 5: Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

PHP – included files

• Included files let you incorporate common elements of the web site (menus, headers, footers, and etc.) onto your web pages with a minimum of code.

• The included files are saved as an external file with the .inc extension

• The included files are referenced in the .php file using the include keyword:

» Example: <?php include (“header.inc”); ?>

Page 6: Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

Using PHP• PHP allows you to create advanced web

applications for the web, such as:• Content managements systems• Login applications• Payment systems and shopping carts,• Mailing list systems• Full e-commerce solutions• Etc.

• PHP well integrated with MySQL database• Can run on UNIX/Linux, Windows, and Mac

platforms.

Page 7: Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

ASP

• ASP – Microsoft Active Server Pages – proprietary Microsoft Technology used to create powerful and dynamic Web pages and sophisticated applications.

• A server side script is added to the HTML code between <% and %> tags.

• The page must be saved with extension .asp• Typically uses VB – Visual Basic script

Page 8: Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

ASP.NET

• ASP – as original server-side scripting solution has largely been supplanted by ASP.NET

• ASP.NET – Microsoft brand name for a framework to build web application

• Runs on Microsoft operating system• ASP.NET languages – C#, VB, J#, Jscript

Page 9: Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

ASP.NET Functionality

• Access a database and display the data from the database

• Allow people to create accounts and log in to your web site

• Add robust form validation to your web forms• Add dynamic web site navigation, and more• Expression Web provides ASP.NET Development

Server, which allows disk-based web site development and page preview in a web browser.

• ASP Development server doesn’t support ASP.

Page 10: Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

ASP.NET pages– a brief intro

• ASP.NET Web pages are called Web Forms• ASP. NET have an .aspx file extension. • Choosing languages

• Expression Web provides the following choices:– C# (pronounced C-sharp), Visual Basic (VB), and Visual J# -9J-

sharp).

• EW provides a set of ASP.NET controls, such as calendar, Add Rotator, Navigation, and many others.

• To use these ASP.NET controls, you need to install MS .NET Framework 2.0

Page 11: Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

ColdFusion• ColdFusion requires ColdFusion Server to run a web

applications• ColdFusion server is a Web application server that lets

developers design and deliver e-commerce and other applications for the Web

• The ColdFusion allows you to create dynamic Web sites by using a tag-based, embedded languages, that is similar to HTML

» Uses ColdFusion Markup Language (CFML)

• ColdFusion is integrated with databases, e-mail servers and other enterprise systems

• ColdFusion is a cross-platform web application server that works on Windows, MAC, and Linux systems

Page 12: Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion

ColdFusion basic syntax

• File extension - .cfm• Include files• <cfinclude template =“header.sfm”>• Creating a variables in ColdFusion <cfset fistname = “John”>

• Output a variable: <cfoutput> My name is

#firstname#</cfoutput> The variable is surrounded with $ (pound sign symbols)