ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: 12252 Week 8 – Review Reference:

Slides:



Advertisements
Similar presentations
PHP syntax basics. Personal Home Page This is a Hypertext processor It works on the server side It demands a Web-server to be installed.
Advertisements

Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
Master’s course Bioinformatics Data Analysis and Tools Lecture 6: Internet Basics Centre for Integrative Bioinformatics.
Creating WordPress Websites. Creating a site on your computer Local server Local WordPress installation Setting Up Dreamweaver.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
Introduction to Web Interface Technology (CSE2030)
The World Wide Web and the Internet Dr Jim Briggs 1WUCM1.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
PHP Scripting Language. Introduction “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language. Originally.
Dynamic Web site With PHP and MySQL. MySQL The combination of MySQL database and PHP scripting language is optimum for building dynamic websites. MySQL.
E-Commerce The technical side. LAMP Linux Linux Apache Apache MySQL MySQL PHP PHP All Open Source and free packages. Can be installed and run on most.
Web Programming Language Dr. Ken Cosh Week 1 (Introduction)
PHP By Dr. Syed Noman Hasany. PHP PHP was originally created by Rasmus Lerdorf in PHP stands for PHP: Hypertext Preprocessor (a recursive acronym).
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
SYST Web Technologies SYST Web Technologies Installing a Web Server (XAMPP)
Linux Operations and Administration
17 Web Servers (Apache and IIS)
SJSU CS157B Dr. Lee1  2004 Jenny Mitchell Two Useful Tools You Can’t Live Without by Jenny Mitchell SJSU CS157B Section PHP and MySQL.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
Web Servers Web server software is a product that works with the operating system The server computer can run more than one software product such as .
© Yanbu University College YANBU UNIVERSITY COLLEGE Management Science Department © Yanbu University College Module 6:WEB SERVER AND SERVER SIDE SCRPTING,
1 HTML and CGI Scripting CSC8304 – Computing Environments for Bioinformatics - Lecture 10.
INTERNET APPLICATION DEVELOPMENT For More visit:
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
FTP (File Transfer Protocol) & Telnet
1 Web Server Administration Chapter 1 The Basics of Server and Web Server Administration.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
School of Computing and Information Systems CS 371 Web Application Programming PHP – Forms, Cookies, Sessions and Database.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Installation and Testing.
SYST Web Technologies SYST Web Technologies Databases & MySQL.
1 Welcome to CSC 301 Web Programming Charles Frank.
Overview: 1. Discussion of the basic architecture of a web application. 2. Discussion of the relevance of using MySQL and PHP in a web application.
Introduction to PHP Advanced Database System Lab no.1.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
1 Session 1: Introduction to PHP & MySQL iNET Academy Open Source Web Development.
PHP on a Fast Track a quick introduction to PHP programming by Jarek Francik last time updated in 2012.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
 2008 Pearson Education, Inc. All rights reserved. Chapter 17 Web Servers (Apache and IIS) Internet & World Wide Web How to Program, 5/e.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
PHP Introduction PHP is a server-side scripting language.
Unit 1 – Web Concepts Instructor: Brent Presley.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 3 – MySQL – Statements.
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 2 – MySQL – database.
PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used, free, and efficient alternative.
1 Server Side scripting PHP. 2 What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
PHP Basics and Syntax Lesson 3 ITBS2203 E-Commerce for IT.
2nd year Computer Science & Engineer
Web Programming Language
Remote hosts and web servers
Introduction to Dynamic Web Programming
Web Development Web Servers.
Pemrograman V (PHP) “Introduction”
PHP / MySQL Introduction
BASIC PHP and MYSQL Edward S. Flores.
Web App vs Mobile App.
Chapter 27 WWW and HTTP.
PHP and Forms.
CS3220 Web and Internet Programming SQL and MySQL
CIS 133 mashup Javascript, jQuery and XML
CS3220 Web and Internet Programming SQL and MySQL
PHP By Prof. B.A.Khivsara Note: The material to prepare this presentation has been taken from internet and are generated only for students reference and.
Presentation transcript:

ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 8 – Review Reference:

Webpage Basic Architecture From Jay Greenspan and Brad Bulger “MySQL/PHP Database Applications”, M&T Books, New York, At the most basic level, the Web works off of a client/server architecture. That means that both a central server and a client application are responsible for some amount of processing.

Web Server and Client Essentially, a Web server is a software application that listens for client connections on a specific network port. When a connection is made, the Web server then waits for a request from the client application. The client is usually a Web browser, but it could also be a Web site indexing utility, or perhaps an interactive telnet session. The resource request, usually a request to send the contents of a file stored on the server, is always phrased in some version of the Hypertext Transfer Protocol (HTTP).

You are here! You can’t see!

Why PHP Fast – written in C but simpler. Easy – Syntax is believed to be superior to ASP and JSP. Easy to learn than Perl – a shell C-like language. Cross-platform Accesses everything – IMAP ( Internet Message Access Protocol ) Mail server, Oracle, Informix, DB2, XML parser, WDDX (Web Distributed Data eXchange ) function, etc.. Constantly being improved – part of open source development. Fully supported all over the world. FREE.

Why MySQL – technical features Written in C and C++. Works on many different platforms. Fully multi-threaded using kernel threads -- can easily use multiple CPUs if available. A very fast thread-based memory allocation system.

Basic UNIX commands Start ‘Command Prompt’ – or type ‘cmd’ from ‘search window’ cd c:\xampp – change to directory ‘c:\xampp’ dir – list all the contents of current folder

Start Xampp 1) In the folder c:\xampp, double click ‘xampp- control.exe’ at 2) Click ‘Start’ for both ‘Apache’ and ‘MySQL’.

Start MySQL 1) Start ‘Command Prompt’ 2) cd c:\xampp\mysql\bin 3) mysql (or ‘mysql –u root’ (no password for now))

MySQL mysql> show databases; (list databases that have been in the system.)

MySQL (2) mysql> use test; (use database ‘test’) Query OK, 1 row affected (0.00 sec) mysql> show tables; mysql> CREATE TABLE y2k (date DATE, -> date_time DATETIME, -> time_stamp TIMESTAMP); Query OK, 0 rows affected (0.00 sec) mysql> INSERT INTO y2k VALUES -> (" "," :59:59", ), -> (" "," :00:00", ), -> (" "," :59:59", ); Query OK, 13 rows affected (0.01 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql>

MySQL (3) mysql> SLECT * from y2k;

Basic PHP Syntax A PHP script can be placed anywhere in the document. A PHP script starts with <?php // PHP code goes here ?> The default file extension for PHP files is ".php". A PHP file normally contains HTML tags, and some PHP scripting code. Example: "Hello World!".

1. First web page //comments <?php echo "My first PHP script!"; ?>

Connection with MySQL <?php $host= "localhost "; $user = "root "; $passwd = " “; $database = “test”; $connect = mysql_connect($host, $user, $passwd); $DBSelect = mysql_select_db($database, $connect); If (!$connect || !$DBSelect) { $Status = "Not connected"; /*. mysql_error();*/ die('Could not connect: '. mysql_error()); } else { $Status = "Connected"; echo 'Connected successfully'; } ?>

Get data from MySQL <?php $host= "localhost"; $user = "root "; $passwd = " “; $database = “test”; $tbl_name = “pet” mysql_connect($host, $user, $passwd) or die("cannot connect server "); mysql_select_db($database) or die("cannot select DB"); $result=mysql_query("SELECT * FROM pet"); while($rows = mysql_fetch_array($result)) { echo $rows['name']. "\t“. $rows['species']. " "; } mysql_close(); //close database ?>

Insert data to MySQL <?php $host= "localhost"; $user = "root "; $passwd = " “; $database = “test”; $tbl_name = “pet” mysql_connect ($host, $user, $passwd) or die("cannot connect server "); mysql_select_db("$database") or die("cannot select DB"); $sql = “Insert Into $tbl_name (Name, species) VALUES (‘Polo', ‘Cat')"; $result = mysql_query ($sql); if($result) { echo "Successful"; echo " "; } mysql_close(); //close database ?>

Together – insert & retrieval <?php $host= "localhost"; $user = "root "; $passwd = " “; $database = “test”; $tbl_name = “pet” mysql_connect ($host, $user, $passwd) or die("cannot connect server "); mysql_select_db("$database") or die("cannot select DB"); $sql=“Insert Into $tbl_name (Name, species) VALUES (‘Polo', ‘Cat')"; $result=mysql_query($sql); $result = mysql_query("SELECT * FROM $tbl_name"); while($rows = mysql_fetch_array($result)) { echo $rows[ ' name ' ]. "\t“. $rows[ ' species ' ]. " "; } mysql_close(); //close database ?>

ITX2000 Course work: CW1(50% marks) Task Installing XAMPP software in a USB stick creating a personal web page to describe your birthplace, including photos to highlight the landmarks of this country/city/town/village This web page allows a feedback form, so that viewers can send their comments no your webpage or to make recommendations, i.e., a guest book. a. Use Apache HTTP server b. Use Mysql to provide the comments database c. Create a database/table to retain/save users’ comments. d. Use PHP language to realise client- server communication