• 沒有找到結果。

教授開發互聯網

N/A
N/A
Protected

Academic year: 2022

Share "教授開發互聯網"

Copied!
49
0
0

加載中.... (立即查看全文)

全文

(1)

運用不同工具 教授開發互聯網 應用及Web應用程 序工作坊

Mr Leung Yiu Tun ICT Teacher St. Stephen’s Girls’ College

(2)

01

Rundown of Today

Introduction to XAMPP

How to download and install Key points on XAMPP Setup

Use of MySQL Server and phpMyAdmin Deployment of a SBA Exemplar

PHP Basics 02

03 04 05 06

(3)

Introduction to XAMPP 01

(4)

XAMPP is a Portable Web Server

XAMPP is the most popular PHP development environment

XAMPP is an abbreviation for cross-platform (X),Apache, MySQL, PHP and Perl

XAMPP is a completely free, easy to install Apache distribution

containing MariaDB, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and to use.

MySQL is now a product under Oracle Corporation and MariaDB is a branch of MySQL.

Reference: https://www.youtube.com/watch?v=h6DEDm7C37A

(5)

It is Multi Cross-Platform, which implies it works on both Windows, Macintosh and Linux. With a single command, you may start and stop the entire web server and

database stack. Both a full and a standard version of XAMPP are available.

Deployment of XAMPP

(6)

● It is Easy to Install as compare to other web servers like WAMP.

● It is Multi Cross Platform which means XAMPP is available for Windows and Linux.

● It also comes with a number of other modules including OpenSSL, phpMyAdmin, MediaWiki, Joomla, WordPress and more.

● XAMPP is offered in both a full and a standard version (Smaller version).

● You can start and stop the whole web server+database stack with one command.

Advantages of Using XAMPP

(7)

How to download and install 02

(8)

Download XAMPP

Visit to https://www.apachefriends.org

For Windows Users

Browse to the “Download” Section and Choose “More Downloads”

Go to the “ XAMPP Windows” / “Latest Version” folder and download “xampp-portable-windows-x64-X.X.X-X-VSXX- installer.exe”

For Mac Users (Non-VM Version)

Browse to the “Download” Section and Choose “More Downloads”

Go to the “XAMPP Mac OS X” / “Latest Version” folder and download “xampp-osx-X.X.X-X-installer.dmg”

(9)

XAMPP Demo

(10)

Key points on XAMPP Setup (Web Server Setup Experience)

03

(11)

Document Root

Windows

DriveLetter:\xampp\apache\conf\httpd.conf MacOS

/Applications/XAMPP/xamppfiles/etc/httpd.conf

Where should I place my web pages?

(12)

Enable PHP On Site Debug Message in Apache

Windows

DriveLetter:\xampp\php\php.ini MacOS

/Applications/XAMPP/xamppfiles/etc/php.ini

Why can’t I see debug

messages of my PHP

scripts?

(13)

phpMyAdmin Alias

Windows

DriveLetter:\apache\conf\extra\httpd-xampp.conf MacOS

/Applications/XAMPP/xamppfiles/etc/extra/httpd-xampp.conf Why can’t I see the folder phpMyAdmin in Document Root?

(14)

MySQL Database

Windows

DriveLetter:\xampp\mysql\data MacOS

/Applications/XAMPP/xamppfiles/var/mysql

Where are my database files stored?

(15)

Use of MySQL Server and phpMyAdmin

04

(16)

Start MySQL Server

(17)

● Firewall?

● Access to Folders?

Grant Necessary Permission

(18)

phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the Web. phpMyAdmin supports a wide range of

operations on MySQL and MariaDB.

phpMyAdmin

(19)

Default Page of XAMPP

(20)

http://localhost/phpmyadmin/

Access to phpMyAdmin

(21)

phpMyAdmin

(22)

Username: root

Password: <empty>

Default Credential for Access to

MySQL Server

(23)

Deployment of a SBA Exemplar 05

(24)

Download SBA Exemplar

Food Order System - Sushi Shop

https://drive.google.com/file/d/1XcupaxsUxM0K8VSfEYgkvSqCMwtxY0zB/view?usp=sharing

HKACE-Elective_B-SBA-Exemplar.zip

(25)

Extract the files into the Document Root

1. Retain the XAMPP files in a backup folder 2. Extract the files in the Document Root

(26)

ProFTPD

A FTP Server is available for use.

Use any FTP client to access Host: localhost

Username: daemon Password: xampp

(27)

Import the Database of Sushi Shop

1. Open sqls.txt in folder “\db\” (SQLs to be pasted into phpMyAdmin)

2. Go to http://localhost/phpmyadmin/

3. Create a database named “food_order”

using character coding system

“utf8mb4_unicode_ci”

4. Browse to the newly created database and click the “SQL” tab, paste the SQLs into the textarea and Execute

(28)

Login the Sushi Shop either by scanning a QR Code or input an

invoice number

Method1: Scanning a QR Code Browse to http://localhost/

Method2: Input an invoice number

Browse to http://localhost/index_style2.php

(29)

Welcoming Screen of Sushi Shop

(30)

Clear Orders of Sushi Shop

(31)

HKDSE ICT 2025 Sample Paper

Elective B

(32)

Create client interfaces

Demo Client-side scripts

(33)

Setup Simple Network Services

Setup Ethernet/Wireless Networks

Folder/File Permissions (Read, Write, Execute)

(34)
(35)

Edit Web Pages

(36)

Concepts of client-server Communication

(37)

Demo Server-side scripts

Differences between Client- side and Server-side

(38)
(39)

Demo Client-side scripts

(40)

Demo Server-side scripts

(41)

Develop a simple web application

(42)

Code Study

PHPs JavaScripts CSSs

index.php

index_style2.php order.php

/include/libraries.php /include/settings.php

/js/shopping_cart.js /js/multi_tabs.js

/css/style.css

/css/responsive.css /css/shopping_cart.css /css/multi_tabs.css

(43)

PHP Basics 06

(44)

https://www.w3schools.com/php/

A Good Website worths to have a look

(45)

PHP starts with <?php PHP ends with ?>

PHP Scripts Start and End

(46)

// This is a single-line comment

# This is also a single-line comment /*

This is a multiple-lines comment block that spans over multiple

lines

*/

PHP - Comments

(47)

In PHP, a variable starts with the $ sign, followed by the name of the variable

Indexed arrays - Arrays with a numeric index

$toys[0] = "car";

Associative arrays - Arrays with named keys

$toys['car'] = "100";

Multidimensional arrays - Arrays containing one or more arrays

$toys[0][0] = "car";

PHP - Variables

(48)

include_once may be used in cases where the same file might be included and evaluated more than once during a particular execution of a script, so in this case it may help avoid problems such as function redefinitions, variable value reassignments, etc.

<?php include_once($_SERVER['DOCUMENT_ROOT'].'/include/header.php');?>

PHP - include_once

(49)

CREDITS:This presentation template was created by Slidesgo, including icons by Flaticon, infographics & images by Freepikand illustrations by

Stories

Thanks!

Do you have any questions?

ytl@hkace.org.hk

Please keep this slide for attribution

參考文獻

相關文件

傳統醫學及互聯網等領域熱點展開討論。其中部分來自世界各地的知名人士包括

Bootstrapping is a general approach to statistical in- ference based on building a sampling distribution for a statistic by resampling from the data at hand.. • The

It’s easy to check that m is a maximal ideal, called the valuation ideal. We can show that R is a

We point out that extending the concepts of r-convex and quasi-convex functions to the setting associated with second-order cone, which be- longs to symmetric cones, is not easy

32 明天 01 中華優秀傳統文化 02 原創圖畫書 03 自製玩教具 04互聯網+ 05

● Permission for files is easy to understand: read permission for read, write permission for modification, and execute permission for execute (if the file is executable). ●

Our main goal is to give a much simpler and completely self-contained proof of the decidability of satisfiability of the two-variable logic over data words.. We do it for the case

Pros: simple, error-free, easy to control Cons: time-consuming, rigid, poor scalability Semantic Frame Natural Language. confirm() “Please tell me more about the product your are