♥ | ||
|
ปรับปรุง : 2568-02-19 (มาร์คดาวน์) |
|
การเขียนโปรแกรมพีเอชพี และจาวาสคริปต์PHP and Javascript ProgrammingThaiall.com/php/php7.htm 3(2-2-5)ปรับปรุง 16 สิงหาคม 2564 |
โฮมเพจที่เกี่ยวข้อง
|
MD1 : markdown viewer extension
|
MD2 : markdown viewer extension"http://www.thaiall.com/md" 1. Extension enable : Markdown Viewer 2. Address Bar : Click เลือก Extension : Markdown Viewer 3. Click : ADVANCED OPTIONS 4. Click : ALLOW ACCESS TO FILE:// URLS 5. Enable : Allow access to file URLs 6. Chrome : file:///D:/phpjs_all.md |
หน่วยที่ 1 ฟูลสแตก (Full Stack)ฟูลสแตก (Full stack)โปรแกรมเอดิเตอร์ (Editor)โปรแกรมบราวเซอร์ (Web Browser)การใช้สื่อสังคม (Social Media) |
ฟูลสแตก (Full stack)
แหล่งสำรวจแล้วจัดอันดับที่น่าสนใจ "https://w3techs.com/" "https://webtechsurvey.com/technology-type" |
ฟูลสแตก (Full stack) - Type of development
|
ฟูลสแตก (Full stack)
Program : Browser (like using JavaScript, jQuery, Angular, or Vue) Program : Server (like using PHP, ASP, Python, or Node) Program : Database (like using SQL, SQLite, or MongoDB)
LAMP stack: JavaScript - Linux - Apache - MySQL - PHP LEMP stack: JavaScript - Linux - Nginx - MySQL - PHP MEAN stack: JavaScript - MongoDB - Express - AngularJS - Node.js Django stack: JavaScript - Python - Django - MySQL Ruby on Rails: JavaScript - Ruby - SQLite - Rails
|
ฟูลสแตก (Full stack)
|
ฟูลสแตก (Full stack)
|
ฟูลสแตก (Full stack) : PHP Manualเอกสารสำหรับผู้เริ่มต้น เป็นคู่มือแบบที่พบใน php.net
เอกสารสำหรับมืออาชีพ
|
นิยามศัพท์ (Technical Terms)
|
นิยามศัพท์ (Technical Terms)
|
นิยามศัพท์ (Technical Terms) : TOP
|
นิยามศัพท์ (Technical Terms)
|
นิยามศัพท์ (Technical Terms)
|
องค์ประกอบของ e-Learning
|
องค์ประกอบของระบบอีคอมเมิร์ซ
|
โปรแกรมเอดิเตอร์ (Editor)
|
ผลสำรวจ editor พบ sublime, notepad++, vim, atom, emacs
|
การ find & replace และใช้ regex บน vscode
|
การ find & replace และใช้ regex บน notepad++
|
การคัดลอกข้อมูลจาก timeshighereducation.com มาใช้ขั้นตอนการปรับปรุงเว็บเพจ (12 กรกฎาคม 2563)
|
การจัดการ code ของ timeshighereducation.comเตรียมข้อมูล ฝึกปฏิบัติ
<style>
.pane-content{background-color:#ddffdd;}
thead{background-color:#dddddd;}
div{background-color:white;float:left;}
.odd{background-color:#ddffdd;}
.even{background-color:#ffffdd;}
</style> |
Regular Expression
|
Regular Expression- คำว่า <div><span><a href="(.*)">(.*)</a></span></div> เป็น <div><span>$2</span></div> ของ vscode - คำว่า <div><span><a href="(.*)">(.*)</a></span></div> เป็น <div><span>\2</span></div> ของ editplus
|
การใช้ editor สั่งแทนที่คำว่า Thailand ด้วย THAILAND
|
โปรแกรมบราวเซอร์ (Web Browser)
|
การใช้สื่อสังคม (Social Media)
|
หน่วยที่ 2 กริต (Git)การใช้บริการ Github.comการเขียน Homepage บน Githubการใช้งาน Github.com |
การใช้บริการ Github.com
|
การเขียน Homepage บน Github
|
หน่วยที่ 3 การใช้กริต (Git)การใช้ Command Lineการใช้ Application |
การใช้ Command Lineคำสั่ง Git
|
การ push
|
การใช้ Application
|
Git GUI
|
หน่วยที่ 4 ภาษาเอชทีเอ็มแอล (HTML)ภาษาเอชทีเอ็มแอล (HTML)ความรู้เกี่ยวกับซีเอสเอส (CSS)ความรู้เกี่ยวกับจาวาสคริปต์ (Javascript) |
ภาษาเอชทีเอ็มแอล (HTML)
|
ความรู้เกี่ยวกับซีเอสเอส (CSS)
|
ความรู้เกี่ยวกับจาวาสคริปต์ (Javascript)
|
Blockly
|
Scratch
|
หน่วยที่ 5 การใช้ซีเอสเอส (CSS)การเขียนเว็บเพจแบบ Responsive Web Designการใช้ CSS ภายในการใช้ CSS ภายนอก |
การเขียนเว็บเพจแบบ Responsive Web Design.m{width:100%;}
@media only screen and (max-width:320px){
.m{width:315px;}
}
@media only screen and (min-width:321px) and (max-width:375px){
.m{width:370px;}
}
@media only screen and (min-width:376px) and (max-width:728px){
.m{width:90%;}
}
|
การใช้ CSS ภายใน<style>
@font-face{font-family:'THBaijam'; src: url('TH Baijam.ttf');}
</style>
<div style="font-family:THBaijam">abc</div>
|
การใช้ CSS ภายนอก<link type="text/css" rel="stylesheet" href="rsp80.css" /> <div class="hello">abc</div>
|
หน่วยที่ 6 ภาษาจาวาสคริปต์ (Javascript)การเขียนเว็บเพจด้วย Javascriptการเรียกใช้ jquery |
การเขียนเว็บเพจด้วย Javascript
|
การเรียกใช้ jquery
|
หน่วยที่ 7 บูทสแตป (Bootstrap)บริการของ Bootstrapการจัดการ Layout |
บริการของ Bootstrap
|
การจัดการ Layout
|
หน่วยที่ 8 เทมเพจด้วยบูทสแตป (Bootstrap)โครงสร้าง AdminTLEการประยุกต์ใช้ AdminTLE |
โครงสร้าง AdminTLE
- starter.html
- index.html index2.html index3.html
/build
/dist
/docs
/pages
/plugins
|
การประยุกต์ใช้ AdminTLE
<html><head><link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" >
<style> body {font-family: 'Source Sans Pro';font-size:20px;font-weight:300;}
.c1 {font-family: 'Source Sans Pro';font-weight:400;font-style:italic;}
.c2 {font-family: 'Source Sans Pro';font-weight:400;}
.c3 {font-family: 'Source Sans Pro';font-weight:700;}
</style>
</head><body>Hello 300
<div class="c1">World 400i</div>
<div class="c2">I am a 400</div>
<div class="c3">man 700</div>
|
หน่วยที่ 9 เครื่องบริการเว็บ (Web Server)เครื่องบริการ (Webserver)โปรแกรม Apacheโปรแกรม MySQLโปรแกรม PHPMyAdmin |
เครื่องบริการ (Webserver)
|
โปรแกรม Apache
|
โปรแกรม MySQL
|
Practice SQL Online" Play online https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all https://www.jdoodle.com/execute-sql-online/ http://sqlfiddle.com/ https://sqliteonline.com/ https://www.mycompiler.io/online-sql-editor https://livesql.oracle.com/ (Tutorial)" |
ระบบฐานข้อมูล Northwind บน w3schools.com
Tablename Records Customers 91 Categories 8 Employees 10 OrderDetails 518 Orders 196 Products 77 Shippers 3 Suppliers 29 |
ระบบฐานข้อมูล Northwind
|
Select (1/19)
select * from orders /* w3schools : ok */ |
Select (2/19)
select * from `order details` -- select * from orderdetails /* w3schools : ok */ |
Select (3/19)
select * from products limit 0,5 /* w3schools : ok */ |
Select (4/19)
select * from products order by productname desc /* w3schools : ok */ |
Select (5/19)
select * from orders where employeeid = 4 /* w3schools : ok */ |
Select (6/19)
select * from orders where freight > 100 and freight < 1000 -- SELECT * FROM [OrderDetails] where quantity > 5 and quantity < 10 |
Select (7/19)
select * from products where QuantityPerUnit like '%pieces%' -- select * from products where unit like '%boxes%' |
Select (8/19)
select `order details`.*, products.* from `order details`,products where `order details`.productid = products.productid /* select [orderdetails].*, products.* from [orderdetails],products where orderdetails.productid = products.productid */ |
Select (9/19)
select `order details`.*, products.* from (`order details` inner join products on `order details`.productid = products.productid) /* select `orderdetails`.*, products.* from (`orderdetails` inner join products on `orderdetails`.productid = products.productid) */ |
Select (10/19)
select orderid, count(orderid) as cnt from `order details` group by orderid -- select orderid, count(orderid) as cnt from `orderdetails` group by orderid |
Select (11/19)
select orderid, sum(quantity * unitprice) as total from `order details` group by orderid /* select orderid, sum(quantity) as total from [orderdetails] group by orderid */ |
Select (12/19)
select `order details`.*, products.* from (`order details` inner join products on `order details`.productid = products.productid) where `order details`.unitprice > 100 /* select `orderdetails`.*, products.* from (`orderdetails` inner join products on `orderdetails`.productid = products.productid) where `orderdetails`.quantity > 10 */ |
Select (13/19)
select orders.customerid, `order details`.*, products.* from orders, (`order details` inner join products on `order details`.productid = products.productid) where `order details`.unitprice > 100 and orders.orderid = `order details`.orderid /* select orders.customerid, `orderdetails`.*, products.* from orders, (`orderdetails` inner join products on `orderdetails`.productid = products.productid) where `orderdetails`.quantity > 10 and orders.orderid = `orderdetails`.orderid */ |
Select (14/19)
select orders.customerid, `order details`.*, products.* from (orders inner join `order details` on orders.orderid = `order details`.orderid inner join products on `order details`.productid = products.productid) where `order details`.unitprice > 100 /* select orders.customerid, `orderdetails`.*, products.* from (orders inner join `orderdetails` on orders.orderid = `orderdetails`.orderid inner join products on `orderdetails`.productid = products.productid) where `orderdetails`.quantity > 10 */ |
Select (15/19)
select orderid, sum(quantity * unitprice) as total from `order details` group by orderid having sum(quantity * unitprice) > 1000 /* select orderid, sum(quantity) as total from `orderdetails` group by orderid having sum(quantity) > 10 */ |
Select (16/19)
select * from `order details` where productid in (select productid from products where unitsinstock = 0) order by productid /* select * from `orderdetails` where productid in (select productid from products where price > 5) order by productid */ |
Select (17/19)
select employees.employeeid, count(orders.orderid) as cnt_orderid from (employees inner join orders on employees.employeeid = orders.employeeid) where orders.shipcountry ='Spain' group by employees.employeeid /* select employees.employeeid, count(orders.orderid) as cnt_orderid from (employees inner join orders on employees.employeeid = orders.employeeid) where orders.shipperid =2 group by employees.employeeid */ |
Select (18/19)
select * from employees where employeeid in (select employees.employeeid from (employees inner join orders on employees.employeeid = orders.employeeid) where orders.shipcountry ='Spain' group by employees.employeeid) /* select * from employees where employeeid in (select employees.employeeid from (employees inner join orders on employees.employeeid = orders.employeeid) where orders.shipperid =2 group by employees.employeeid) */ |
Select (19/19)
select emp_left.employeeid, emp_right.cnt_order from employees emp_left left join (select orders.employeeid, count(orders.orderid) as cnt_order from orders where orders.shipcountry ='Spain' group by orders.employeeid) emp_right on emp_right.employeeid = emp_left.employeeid /* select emp_left.employeeid, emp_right.cnt_order from employees emp_left left join (select orders.employeeid, count(orders.orderid) as cnt_order from orders where orders.shipperid =2 group by orders.employeeid) emp_right on emp_right.employeeid = emp_left.employeeid */ |
โปรแกรม PHPMyAdmin
|
JMeter
|
หน่วยที่ 10 เฟรมเวิร์คพีเอชพี (PHP Framework)โปรแกรมลาราเวล (PHP Framework : Laravel)โปรแกรม Composerโปรแกรม Node.js |
โปรแกรมลาราเวล (PHP Framework : Laravel)
DOS> composer create-project --prefer-dist laravel/laravel helloworld
พบปัญหา
[Composer\Downloader\TransportException]
Unable to use a proxy: malformed http_proxy url
น่าจะเกิดจาก : ขณะติดตั้ง composer ไปเลือก Check : Use a proxy server to connect to internet
DOS> composer diagnose (เพื่อตรวจสอบ composer)
DOS> netsh winhttp show proxy (เพื่อตรวจสอบ proxy)
DOS> echo %HTTP_PROXY%
DOS> set
วิธีแก้ไข
ในกรณีไม่จำเป็นต้องผ่าน proxy แต่ไปเลือก proxy ในขณะติดตั้ง composer
วิธีที่ 1. ลบตัวแปร Control Panel -> System -> Advanced system settings -> Environment Veriables -> http_proxy
วิธีที่ 2. DOS> set http_proxy= และ set https_proxy
วิธีที่ 3. DOS> netsh winhttp reset proxy |
ติดตั้ง Laravel ด้วย ComposerDOS>node -v (v10.15.3)
DOS>npm -v (6.4.1)
DOS>npx -v (6.4.1)
# ติดตั้ง Laravel ด้วย Composer
DOS> composer create-project --prefer-dist laravel/laravel ex1
DOS> xcopy ex1 ex1b /e (เพื่อสำรองก่อนปรับปรุง หรือหลังผ่านการทดสอบ)
/e คือ Copies directories and subdirectories, including empty ones.
DOS> cd ex1
DOS> php artisan -V (Laravel Framework 7.9.2)
DOS> php artisan serve
> Laravel development server started: http://127.0.0.1:8000 (Ctrl+C)
[Folder] (8,596 Files, 1,542 Folders, 36.6MB)
app
bootstrap
config
database
public
resources
routes
storage
tests
vendor |
โปรแกรม Composer
https://getcomposer.org/Composer-Setup.exe
1. DOS> composer -v
2. DOS> cd c:\xampp\htdocs
3. DOS> composer require erusev/parsedown
Using version ^1.7 for erusev/parsedown
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing erusev/parsedown (1.7.4): Downloading (100%)
Writing lock file
Generating autoload files
4. พบใน c:\xampp\htdocs
composer.json
composer.lock
/vendor
/vendor/autoload.php
/vendor/composer มี 8 แฟ้ม
/vendor/erusev
/vendor/erusev/parsedown/ มี 4 แฟ้ม
5. test1.php
<?php
require_once 'vendor/erusev/parsedown/parsedown.php';
$parsedown = new Parsedown();
$text = file_get_contents('test1.md');
echo $parsedown->text($text);
// echo $parsedown->line($text); ไม่มีการจัดรูปแบบแยก paragraph
6. localhost/test1.php |
โปรแกรม Node.js
ทดสอบตัวอย่างการใช้ Node.js เบื้องต้น - DOS> npx create-react-app hello - DOS> cd hello - DOS> npm start - DOS> explorer http://localhost:3000 |
หน่วยที่ 11 ลาราเวล (Laravel)การทำงานกับลาราเวล (Laravel)หลักการ Modelหลักการ Viewหลักการ Controller |
การทำงานกับลาราเวล (Laravel)
|
หลักการ ModelModels in Laravel
https://laravel.com/docs/7.x/eloquent#introduction
https://laravel.com/docs/7.x/migrations
https://blog.pusher.com/laravel-mvc-use/
cd htdocs
php artisan (Could not open input file: artisan)
cd ex4
php artisan (Laravel Framework 7.6.2)
editplus.exe htdocs/ex4/config/database.php
'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''),
'database' => env('DB_DATABASE', 'test'), 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', ''),
php artisan make:model Flight --migration
Created Migration: 2020_04_24_140657_create_flights_table
พบแฟ้มนี้ใน ex4/database/migrations/2020_04_24_140657_create_flights_table.php
บรรทัดที่ 17 พบ $table->id();
เพิ่ม $table->string('name',100)->charset('utf8')->default(0);
เพิ่ม $table->integer('salary');
ก่อนบรรทัดนี้ $table->timestamps();
พบ Flight.php ใน ex4/app
เปิดแฟ้ม ex4/.env
เปลี่ยน DB_DATABASE=laravel เป็น test
php artisan migrate
สร้างตาราง Flights มาให้
---
xampp/mysql_start.bat
cd xampp/mysql/bin
mysql -u root -p (Server version: 10.4.11-MariaDB)
use test;
create table books (
id int(11) NOT NULL,
name varchar(256) NOT NULL,
category varchar(256) NOT NULL,
description text NOT NULL
);
|
หลักการ View
<div class="flex-center position-ref full-height">
<div class="content">
<div class="title m-b-md">Product Store</div>
<div class="links">
<a href="{{ config('app.url')}}/products/create">Create Product</a>
<a href="{{ config('app.url')}}/products">View Products</a>
</div>
</div>
</div>
|
หลักการ Controllerจะพบแฟ้ม ProductController.php ใน ex4/app/Http/Controllers
public function create()
{
return view('createproduct'); // เพิ่มมาใหม่
}
public function store(Request $request)
{
\App\Product::create([
'name' => $request->get('name'),
'description' => $request->get('description'),
'price' => $request->get('price'),
'count' => $request->get('count'),
]);
return redirect('/products');
}
public function index()
{
$products = \App\Product::all();
return view('viewproducts', ['allProducts' => $products]);
}
|
หน่วยที่ 12 การจัดการข้อมูล (CRUD Package)การติดตั้ง (Install)การสร้าง (Create)การอ่าน (Read)การปรับปรุง (Update)การลบ (Delete) |
การติดตั้ง (Install)
|
การติดตั้ง (Install)
|
การติดตั้ง (Install)CRUD generator package https://medium.com/ideagital/มาใช้งาน-laravel-crud-generator-ตัวช่วยสร้าง-crud-สำเร็จรูป-c465ffe8f074 DOS> php artisan -V Laravel Framework 7.16.1 - โหลด appzcoder/crud-generator DOS> composer require appzcoder/crud-generator --dev ดึง assets ขึ้นมาใช้งาน DOS> php artisan vendor:publish --provider="Appzcoder\CrudGenerator\CrudGeneratorServiceProvider" เริ่มสร้าง crud http://www.thaiall.com/project/projectdbnwind.htm DOS> php artisan crud:generate Categories --fields="categoryid#integer; categoryname#string; description#text" --view-path=northwind --controller-namespace=northwind --route-group=northwind --form-helper=html พบแฟ้ม ex1/database/migrations/2020_06_23_120044_create_categories_table.php ex1/app/Category.php ex1/app/Http/Controllers/Northwind/CategoriesController.php ex1/resources/views/northwind/categories - create.blade.php - edit.blade.php - form.blade.php - index.blade.php - show.blade.php DOS> php artisan route:list มีให้เรียกใช้เยอะเลย Route Name categories.store categories.index categories.create categories.update categories.show categories.destroy categories.edit mysql_start.bat DOS> php artisan migrate DOS> php artisan serve 127.0.0.1/northwind/categories 127.0.0.1:8000/northwind/categories
|
การสร้าง (Create)
|
ทดสอบตัวอย่างการใช้ Node.js เบื้องต้น
|
การอ่าน (Read)
<!DOCTYPE html><html><body> <h1>Summer</h1><p>I love the sun!</p> </body></html> <!DOCTYPE html><html><body> <h1>Winter</h1><p>I love the snow!</p> </body></html>
|
การปรับปรุง (Update)
editplus.exe mytest/routes/web.php
Route::get('/changename', function () { return view('changename'); });
Route::post('/changename', 'test1Controller@changename');
editplus.exe resources/views/changename.blade.php
<!doctype html><html><head><title>Changename</title></head><body>
<div class="flex-center position-ref full-height">
<div class="content">
<form method="POST" action="{{ config('app.url')}}/changename">
@csrf
<h1>Changename</h1>
<div class="form-input"><label>ID</label><input type="text" name="id"></div>
<div class="form-input"><label>Name</label><input type="text" name="name"></div>
<button type="submit">Submit</button>
</form>
</div></div></body></html>
https://github.com/scotch-io/laravel-database-course/blob/master/app/Http/Controllers/UserController.php
editplus.exe app/Http/Controllers/test1controller.php
public function changename(Request $request) {
$myid = $request->id;
$myname = $request->name;
$chg = \App\test1::find($myid);
$chg->name = $myname;
$chg->save();
// หรือ $affectedRows = \App\test1::where("id", $myid)->update(["name" => $myname]);
return redirect('/test1');
}
|
การลบ (Delete)
- คัดลอก welcome.blade.php เป็น deluser.blade.php
- เปิด web.php ใน ex1/routes มาแก้ไข
- เพิ่มบรรทัด
Route::get('/delu', 'HomeController@delu');
Route::post('/delu', 'HomeController@delbyid');
- เปิด HomeController.php ใน ex1/app/Http/Controllers เพิ่ม public function delu(){ return view('deluser'); }
- เพิ่ม บรรทัดต่อไปนี้ ใน deluser.blade.php
<form method="POST" action="{{ config('app.url')}}/delu">
@csrf
<div class="form-input"><input type="text" name="name"></div>
<!-- input type="hidden" name="_token" value="{{ csrf_token() }}" -->
<!-- TokenMismatchException in VerifyCsrfToken.php line 67: -->
<button type="submit">Submit</button>
</form>
- DOS> php artisan make:model mgmtusers (ไม่มีโมเดลต่างเครื่อง)
- แก้ไข mgmtusers.php ใน ex1/app เพิ่ม protected $table = 'users'; ถ้าไม่เพิ่มจะมีค่าปริยายเป็น "mgmtusers"
- เปิด HomeController.php ใน ex1/app/Http/Controllers เพิ่ม
public function delbyid(Request $request) {
$myname = $request->name;
$usr = \App\mgmtusers::where('name',$myname)->first();
$usr->delete();
return redirect('/welcome');
}
|
หน่วยที่ 13 รีแอ็ค (React)การติดตั้ง Reactการเขียนเว็บเพจด้วย React |
การติดตั้ง React
|
การเขียนเว็บเพจด้วย React
|
การเรียกใช้ Node.js URL Module
|
code<h1>Summer</h1> <p>I love the sun!</p> <h1>Winter</h1> <p>I love the snow!</p> |
code ใน demo.jsvar http = require('http');
var url = require('url');
var fs = require('fs');
http.createServer(function (req, res) {
var q = url.parse(req.url, true);
var filename = "." + q.pathname;
fs.readFile(filename, function(err, data) {
if (err) {
res.writeHead(404, {'Content-Type': 'text/html'});
return res.end("404 Not Found");
}
res.writeHead(200, {'Content-Type': 'text/html'});
res.write(data);
return res.end();
});
}).listen(8080); |
หน่วยที่ 14 ไลน์ (Line)การใช้บริการ Line notifyการเขียนสคริปต์ส่งข้อความหลายกลุ่ม |
การใช้บริการ Line notify
|
การเขียนสคริปต์ส่งข้อความหลายกลุ่ม
|
การทำ Line notify ส่งข้อความเข้า Line group
|
การสร้าง Token
|
ตัวอย่าง code ใน sendnotify.php แบบ curl$headers = array('Content-Type: application/x-www-form-urlencoded','Authorization: Bearer ' . '.. token ..');
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, 'https://notify-api.line.me/api/notify');
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, 'message='. 'hello' );
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec( $ch );
curl_close( $ch );
var_dump(json_decode($result,TRUE)); |
ตัวอย่าง code ใน sendnotify.php แบบ file_get_contentsif(!ini_get('allow_url_fopen')) die('file_get_contents : Disabled');
$data = array("message" => 'hello');
$data = http_build_query($data,'','&');
$headerOptions = array('http'=>array('method'=>'POST',
'header'=> 'Content-Type: application/x-www-form-urlencoded\r\n'
.'Authorization: Bearer '.'.. token ..'.'\r\n'.'Content-Length: '.strlen($data).'\r\n','content' => $data),);
$context = stream_context_create($headerOptions);
$result = file_get_contents('https://notify-api.line.me/api/notify',FALSE,$context);
$res = json_decode($result); |
หน่วยที่ 15 มัลติมีเดีย(Multimedia)สื่อแบบ Audio และ Videoสื่อแบบ Flash |
สื่อแบบ Audio และ Video<audio controls> <source src="horse.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio>
|
สื่อแบบ Flash
<object id="lesson0201">
<embed name="lesson0201" src="lesson0201.swf" width="100" height="80"
type="application/x-shockwave-flash">
</embed>
</object>
|
End
|
โครงงานระบบสั่งซื้อบริษัท Northwind (1/4)กิจกรรมที่ต้องมีในตัวโครงงาน
|
โครงงานระบบสั่งซื้อบริษัท Northwind (2/4)
|
โครงงานระบบสั่งซื้อบริษัท Northwind (3/4)
|
โครงงานระบบสั่งซื้อบริษัท Northwind (4/4)
|
ประเด็นที่น่าสนใจ (1/2)
|
ประเด็นที่น่าสนใจ (2/2)"Technology: Laravel - php, Django - python , Node.js , React Mobile , Desktop , Server , API, Library, Bootstrap, JQuery Social media, Blog, Retouch, Optimization, SEO, Line notify, E-book การใช้บริการ Free webhosting หรือติดตั้ง web server http://www.thaiall.com/blog/burin/8834/ - ทดสอบ Free web hosting http://www.thaiall.com/omni/indexo.html - hosting และ script การใช้ FTP ทั้ง command line และ filezilla หรือโปรแกรมอื่น http://www.thaiall.com/learn/useftp.htm การเขียน Markdown นำเสนอผลงาน http://www.thaiall.com/md/ - ใช้งานบน github.com การบีบอัดแฟ้ม .rar หรือ .zip แบบกำหนดรหัสผ่าน https://www.protectedzip.com/ การสร้างแฟ้มจำนวนมาก นับแสนแฟ้ม นับล้านแฟ้ม ที่มีเนื้อหา และด้วยภาษาต่าง ๆ เช่น php หรือ java หรือ python หรือ C# http://www.thaiall.com/php/ - ต.ย.73 สร้างหมื่นแฟ้มใช้เวลา 10 วินาที http://www.thaiall.com/class/ - สร้างแฟ้มจำนวนมาก ด้วย จาวา http://www.thaiall.com/python/ - สร้างแฟ้มขนาด 1 MB การเขียนโปรแกรมจัดการข้อมูล http://www.thaiall.com/project/projectdbnwind.htm การใช้ phpmyadmin หรือ command line จัดการ mysql http://www.thaiall.com/mysql/ การ select ข้อมูลแบบ inner join http://www.thaiall.com/project/projectdbnwind.htm การ insert , delete , update http://www.thaiall.com/php/training492.htm การจัดการข้อมูลด้วย php 357 http://www.thaiall.com/perlphpasp/source.pl?key=9144 การค้นหาจุดผิดพลาด 20 จุด ใน PHP http://www.thaiall.com/perlphpasp/source.pl?key=9148 การเขียน CSS แบบ internal, external , in line http://www.thaiall.com/perlphpasp/source.pl?key=9147 การสร้างอัลบั้มตาม template http://www.thaiall.com/actress/joom.htm การใช้ Web template เช่น adminlte http://www.thaiall.com/adminlte/ การใช้จัดการข้อมูลใน mysql บน adminlte template แบบตารางเดียว http://www.thaiall.com/adminlte/ การใช้จัดการข้อมูลใน mysql บน adminlte template แบบหลายตาราง http://www.thaiall.com/mysql/ การใช้ vscode เปลี่ยนรู้แบบข้อมูล ระหว่าง json กับ csv กับ sql http://www.thaiall.com/vscode/ การใช้งาน google chart + php + mysql http://www.thaiall.com/php/ การใช้งาน api หรือ javascript library เช่น google map http://www.thaiall.com/jslibrary/ การใช้ HTML5 วาดภาพ http://www.thaiall.com/html5/ การใช้ Python - Turtle วาดภาพ http://www.thaiall.com/python/ การใช้ Wordpress เขียน blog + homepage http://www.thaiall.com/wordpress/ การใช้ Woocommerce บน wordpress มีการเพิ่มสินค้า การสั่งซื้อ การจัดการบัญชี http://www.thaiall.com/wordpress/ การจัดการ repository บน github.com และใช้ git command และใช้ vscode http://www.thaiall.com/git/ การใช้ CSS แบบ external file, internal file และ inline http://www.thaiall.com/web2/ การใช้ html + javascript + css + library ภายนอก http://www.thaiall.com/java/ https://console.cloud.google.com/projectselector2/google/maps-apis/overview การเขียนโปรแกรม java ประมวลผลได้ csv, text, json ที่ประยุกต์ใช้ template แล้วสร้างแฟ้ม http://www.thaiall.com/class/ การสร้างแอพแบบ no code ด้วย thunkable หรือ appinventor.mit.edu http://www.thaiall.com/programming/helloworld.htm การสร้าง mobile app บน thunkable.com หรือ appinventor.mit.edu ที่ใช้ webview http://www.thaiall.com/actress/joom.htm http://www.thaiall.com/adminlte/ web view - google form การเขียนเว็บเพจ บน google drive หรือ one drive แล้วใช้บริการ https://drv.tw/ สร้าง webpage link การเขียนคำสั่ง SQL ผ่าน command line และ phpmyadmin ให้ได้ผลตามที่ต้องการ http://www.thaiall.com/mysql/ ระบบเมนู ควบคุมด้วย user หรือ admin ที่ใช้ php + mysql http://www.thaiall.com/mysql/ การเขียนโปรแกรมจัดการข้อมูล แบบหลายตาราง และแยกแฟ้มโปรแกรม http://www.thaiall.com/perlphpasp/source.pl?key=9148 การเขียนรายงานการวิจัย http://www.thaiall.com/research/" |
สรุปการออกแบบ joom.htm
|
การเรียนรู้ในศตวรรษที่ 21 (1/6)
|
ทักษะที่จำเป็นสำหรับการเรียนรู้ในศตวรรษที่ 21 (2/6)
|
ทักษะสำคัญที่คนส่วนใหญ่ให้ความสำคัญมาก (3/6)
|
ทักษะที่จำเป็นสำหรับการเรียนรู้ในศตวรรษที่ 21 (4/6)
|
ความเป็นพลเมืองดิจิทัล (5/6)
|
ทักษะจำเป็น เพื่อก้าวสู่การเป็นพลเมืองดิจิทัล (6/6)
|
5 ซอฟต์สกิล และ 5 ฮาร์ดสกิล เพื่อได้งานและรักษางาน
|
5 ซอฟต์สกิล และ 5 ฮาร์ดสกิล เพื่อได้งานและรักษางาน
|
สุดยอด 3 เรื่องเล่าเร้าพลังใจ
|
python : introduction
https://www.python.org/downloads/
https://www.python.org/ftp/python/3.9.6/python-3.9.6-amd64.exe (25 MB)
1) Search , python 2) Start button, IDLE - window form 2) Start button, Python - command line* 4) Run, py 5) run, cmd, py
C:\> py
>>> exit() หรือ ctrl-break
C:\> nodepad myserver.py (210 bytes)
import os
from http.server import HTTPServer, CGIHTTPRequestHandler
os.chdir('.')
server_object = HTTPServer(server_address=('', 80), RequestHandlerClass=CGIHTTPRequestHandler)
server_object.serve_forever()
C:\> py myserver.py (Allow access)
http://localhost in chrome หรือ http://localhost/myserver.py in chrome
Ctrl-Break to stop server |
python : cgi-binสร้าง folder cgi-bin ใน root directory
ใช้ notepad สร้างแฟ้ม hello.py ใน cgi-bin
print ("Content-Type: text/html\n\n")
print ("Hello World!")
เปิด localhost/cgi-bin/hello.py จะเห็นเฉพาะ Hello World!
ถ้าสร้างแฟ้ม hello.py ใน root directory แล้วเปิด จะเห็น source code |
python : flaskติดตั้ง Flask
C:\> py -m pip install Flask
C:\> notepad code1.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def Home():
return "<h1>Hello</h1>"
if __name__ == '__main__':
app.debug = True
app.run(host='0.0.0.0', port=8000)
C:\> py code1.py
explorer http://172.50.0.7:8000/
Ctrl-C to quit
https://www.borntodev.com/2020/02/19/ทำเว็บด้วย-python/ |
python : djangoDjango framework บน python C:\> py -m pip install --upgrade pip C:\> py -m pip install django C:\> py -m pip uninstall django C:\> py -m pip install -e django C:\> cd C:\Users\LAB\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.9 C:\> cd C:\Users\LAB\AppData\Local\Programs\Python\Python39 https://www.stanleyulili.com/django/how-to-install-django-on-windows/ C:\django> py -m venv venv C:\django> venv\Scripts\activate (venv) C:\Users\LAB\django> (venv) C:\Users\LAB\django> pip install django (venv) C:\Users\LAB\django> django-admin --version (3.2.5) (venv) C:\Users\LAB\django> django-admin startproject testsite (venv) C:\Users\LAB\django> cd testsite (venv) C:\Users\LAB\django> dir (venv) C:\Users\LAB\django> python manage.py runserver explorer http://127.0.0.1:8000/ Ctrl-Break to quit >>> import django >>> django <module 'django' from 'C:\\Users\\LAB\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\django\\__init__.py'> https://codeburst.io/%E0%B9%80%E0%B8%A3%E0%B8%B4%E0%B9%88%E0%B8%A1%E0%B8%9E%E0%B8%B1%E0%B8%92%E0%B8%99%E0%B8%B2-web-application-%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B2-python-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-django-framework-38ce132ac706 |
python : functionC:\> nodepad input.py
def checkName(name):
checkName = input("Name :" + name + "?")
if checkName.lower() == "yes":
print("Hello,", name)
else:
print("no boy")
checkName("boy")
C:\> py input.py |
python : File 1 MBf = open("d:\onembpy.htm","w+")
v =""
for i in range(100000): v+=("12345678\n")
f.write(v)
f.close()
# https://www.guru99.com/reading-and-writing-files-in-python.html
# https://www.tutorialspoint.com/python/python_files_io.htm |
python : logo - turtlefrom turtle import *
bgpic("roadmap.png")
color('red', 'yellow')
begin_fill()
while True:
forward(200)
left(160) # 170
if abs(pos()) < 1:
break
end_fill()
penup(); setpos((-100,100))
pendown()
right(90)
forward(40); left(90)
forward(70); right(90)
forward(120); left(90)
forward(60); left(90)
forward(75); right(90)
forward(75)
done() |
อ่านหนังสือ e-book (1/3)"แหล่งอีบุ๊ค (E-book Center) 1. ฟรีอีบุ๊ค ด้านสุขภาพ https://multimedia.anamai.moph.go.th/ebooks/ 2. ฟรีอีบุ๊ค ด้านสุขภาพ https://www.free-ebooks.net/health 3. ฟรีอีบุ๊ค กรมสุขภาพจิต https://new.camri.go.th/ebook 4. ฟรีอีบุ๊ค สถาบันการจัดการระบบสุขภาพ http://hsmi.psu.ac.th/?page_id=1714 5. ฟรีอีบุ๊ค มหาวิทยาลัยรามคำแหง http://e-book.ru.ac.th/ 6. ฟรีอีบุ๊ค ด้านคอมพิวเตอร์ https://goalkicker.com 7. ฟรีอีบุ๊ค ด้านคอมพิวเตอร์ https://riptutorial.com/ebook/ 8. ฟรีอีบุ๊ค ด้านคอมพิวเตอร์ https://allitbooks.net/ 9. ฟรีอีบุ๊ค ด้านภาษาอังกฤษ https://indeedproject.org/free-ebooks/ 10. ร้านหนังสืออีบุ๊ค https://www.packtpub.com/ 11. ร้านหนังสืออีบุ๊ค https://www.se-ed.com/e-books.aspx 12. ร้านหนังสืออีบุ๊ค https://www.naiin.com/e-books/ 13. ร้านหนังสืออีบุ๊ค https://www.chulabook.com/en/main-ebook 14. ร้านหนังสืออีบุ๊ค https://www.ookbee.com/ 15. ร้านหนังสืออีบุ๊ค https://www.mebmarket.com/ 16. ร้านหนังสืออีบุ๊ค https://www.ebooks.in.th/ 17. ร้านหนังสืออีบุ๊ค http://store.2ebook.com/ 18. ร้านหนังสืออีบุ๊ค https://www.ebooks.com/en-th/ 19. ร้านหนังสืออีบุ๊ค https://books.google.com/ 20. ร้านหนังสืออีบุ๊ค https://www.barnesandnoble.com/" |
อ่านหนังสือ e-book (2/3)"ระบบห้องสมุดออนไลน์ (Online library system) 1. ห้องสมุดออนไลน์สถาบัน Goethe http://www.goethe.de/ins/th/th/ban/kul/bib/onl.html 2. ห้องสมุดพระพุทธศาสนานานาชาติมหาสิรินาถ http://www.mahasirinath.com/searchpage.asp 3. ห้องสมุดมหาจุฬาลงกรณราชวิทยาลัย http://library.mcu.ac.th/home/ 4. ห้องสมุดออนไลน์ในประเทศไทย http://www.correct.go.th/hrd/library.htm 5. Globethics.net http://www.globethics.net 6. Buddhist eLibrary http://www.buddhistelibrary.org/th/index.php?cat=41 7. Open Library https://openlibrary.org/ 8. American Library https://archive.org/details/americana 9. Online Christian Library http://www.patheos.com/Library 10. Library of World Religions and Faith Traditions http://www.patheos.com/Library 11. Islamic Library http://www.minhajbooks.com/english/index.html 12. Al Islam http://www.alislam.org/books/ 13. Jewish Virtual Library http://www.jewishvirtuallibrary.org/ - แนะนำแหล่งสืบค้นข้อมูล https://www.ium-thai.org/blank-18" |
อ่านหนังสือ e-book (3/3)"แหล่งสืบค้นเอกสารทั่วไป/เอกสารเฉพาะด้าน (Document search engine) 1. ฐานข้อมูลวารสารอิเล็กทรอนิกส์กลาง https://www.tci-thaijo.org (ThaiJO) 2. เครือข่ายห้องสมุดอุดมศึกษาไทย https://tdc.thailis.or.th/tdc/basic.php (ThaiLIS) 3. รวมข้อมูลประชุมวิชาการ http://www.conferenceinthai.com/ 4. Government open data http://www.data.go.th 5. อาร์ไคฟ์เก็บเว็บไซต์ http://www.archive.org 6. วิกิพีเดียร์ https://www.wikipedia.org 7. พจนานุกรม https://dict.longdo.com 8. อักขราวิสุทธิ์ http://plag.grad.chula.ac.th 9. แหล่งเผยแพร่ scribd.com http://www.scribd.com 10. แหล่งเผยแพร่ slideshare.net http://www.slideshare.net 11. แหล่งเผยแพร่ issuu.com http://www.issuu.com 12. แหล่งเผยแพร่ flipsnack.com http://www.flipsnack.com" |
บริการประมวลผลออนไลน์ (1/22)
" https://www.ilovepdf.com/word_to_pdf
https://smallpdf.com/word-to-pdf
https://www.adobe.com/sea/acrobat/online/word-to-pdf.html
https://www.freepdfconvert.com/word-to-pdf
https://www.sodapdf.com/word-to-pdf/" |
เพิ่มเลขหน้าให้ pdf (2/22)
" https://www.ilovepdf.com/add_pdf_page_number
https://smallpdf.com/add-page-numbers-to-pdf
https://tools.pdf24.org/en/add-page-numbers-to-pdf
https://www.sodapdf.com/add-page-numbers-to-pdf/
https://www.cleverpdf.com/pdf-page-number" |
ปลดล็อกรหัสแฟ้ม pdf (3/22)
" https://smallpdf.com/unlock-pdf/
https://www.ilovepdf.com/unlock_pdf/
https://www.sodapdf.com/unlock-pdf/
https://pdf.io/unlock/
https://www.pdf2go.com/unlock-pdf
https://pdfbear.com/unlock-pdf" |
ลดขนาดแฟ้มให้เล็กลง (4/22)
" https://www.reduceimages.com/
https://www.iloveimg.com/resize-image
https://tinypng.com/
https://www.img2go.com/compress-image
https://www.resizepixel.com/reduce-image-in-kb/
https://resizeimage.net/" |
ลบภาพพื้นหลัง (5/22)
" https://www.remove.bg/
https://removal.ai/
https://photoscissors.com/
https://clippingmagic.com/
https://www.fococlipping.com/
https://www.photoroom.com/background-remover/" |
จำลองตัวแปลภาษา (6/22)
" https://www.tutorialspoint.com/compile_java_online.php
https://www.jdoodle.com/online-java-compiler/
https://www.onlinegdb.com/online_java_compiler
https://jsfiddle.net/
https://code.labstack.com/
https://www.programming-hero.com/code-playground/python/index.html
https://www.w3schools.com/html/tryit.asp?filename=tryhtml_basic
https://nostarch.com/scratch3playground
https://developers.google.com/blockly
https://blockly.programming.in.th/
https://blockly-demo.appspot.com/static/demos/code/index.html" |
จำลองฐานข้อมูลใช้ SQL (7/22)
" https://www.w3schools.com/sql/
http://sqlfiddle.com/
https://www.jdoodle.com/execute-sql-online/
https://sqliteonline.com/
https://www.mycompiler.io/new/sql
https://www.db-fiddle.com/" |
จำลองระบบลีนุกซ์ (8/22)
" https://itsfoss.com/online-linux-terminals/
https://bellard.org/jslinux/
https://cocalc.com/doc/terminal.html
https://www.masswerk.at/jsuix/index.html
http://cb.vu/
https://linuxcontainers.org/lxd/try-it/" |
เข้ารหัสถอดรหัส base64 (9/22)
" https://www.base64encode.net/
https://codebeautify.org/base64-decode
https://elmah.io/tools/base64-image-encoder/
https://www.utilities-online.info/base64
https://rawgit.com/MrRio/jsPDF/master/fontconverter/fontconverter.html" |
จัดเรียงข้อมูลตัวอักษร (10/22)
" https://codebeautify.org/sort-text-lines
https://textmechanic.com/text-tools/basic-text-tools/sort-text-lines/
https://www.ipvoid.com/sort-text-lines/
https://www.textfixer.com/tools/alphabetical-order.php
https://alphabetizer.flap.tv/" |
แปลงแฟ้มภาพเป็น webp (11/22)
" https://convertio.co/png-webp/
https://image.online-convert.com/convert-to-webp
https://cloudconvert.com/webp-converter
https://ezgif.com/jpg-to-webp
https://converter.11zon.com/en/image-to-webp/" |
แปลศัพท์/ตรวจคำ (12/22)
" https://translate.google.com/
https://dict.longdo.com/
https://www.reverso.net/
https://itranslate.com/
http://plag.grad.chula.ac.th/
https://plagiarismdetector.net/" |
ตรวจ grammar (13/22)
" https://www.grammarly.com/
https://instatext.io/
https://www.grammarcheck.net/editor/
https://languagetool.org/
https://www.reverso.net/spell-checker/english-spelling-grammar/" |
บริการเว็บโฮสติ้ง (14/22)
" https://www.000webhost.com/
https://infinityfree.net/
https://sites.google.com/
https://www.awardspace.com/
https://github.com/
https://themeisle.com/blog/best-free-website-hosting/" |
บริการพื้นที่เก็บข้อมูล (15/22)
" https://www.google.com/drive/
https://onedrive.live.com/
https://www.4shared.com/
https://www.dropbox.com/
https://www.box.com/" |
บริการ cloud office (16/22)
" https://docs.google.com/
https://www.office.com/
https://www.huaweicloud.com/
https://www.libreoffice.org/
https://www.onlyoffice.com/" |
บริการ e-journal (17/22)
" https://www.tci-thaijo.org/
https://tdc.thailis.or.th/tdc/basic.php
http://www.conferenceinthai.com/" |
บริการ e-book (18/22)
" https://www.ookbee.com/
https://bookboon.com/
https://books.goalkicker.com/
https://www.packtpub.com/
https://www.scribd.com/" |
บริการ e-commerce (19/22)
" https://shopee.co.th/
https://www.lazada.co.th/
https://www.oscommerce.com/
https://woocommerce.com/" |
บริการ e-learning (20/22)
" https://moodle.org/
https://classroom.google.com/
https://www.microsoft.com/th-th/microsoft-teams" |
บริการ e-assistant (21/22)
" https://www.apple.com/siri/
https://assistant.google.com/
Smart device เช่น Microsoft hololens 2 หรือ Google Glass" |
บริการ virtual world (22/22)
" Social media
Online game - mmorpg
https://secondlife.com/" |
| "ไม่เริ่มต้นในวันนี้ จะไม่มีทางสำเร็จในวันพรุ่ง" โดย โยฮัน ว็อล์ฟกัง ฟ็อน เกอเทอ |