Demo
IDE
PHP
- download : https://www.php.net/downloads.php
- Change download folder name to
php
. - Move Download folder to
C:\
. - Change
php.ini-development
tophp.ini
onc:\php
. - Add
C:\php
on path. - Manual : https://www.php.net/manual/en/
MySQL
- download : https://dev.mysql.com/downloads/mysql/
- Add
c:\Program Files\MySQL\MySQL Server X.X\bin
on path.
Functions
File Upload & Download
GET
$_SERVER
is a global variable for server.- You can get requested methods from
REQUEST_METHOD
. - You can write HTML code in php with
<<<'HTML'...HTML;
.
POST
$_FILES
is a global variable for array of items uploaded to the current HTTP POST method.pathinfo
returns file path via array.__FILE__
means current file.
Download
header
sends a raw HTTP header. For example,header('Location: /')
return url~/
.realpath
is for the security. If there is no filename like the argument, return null.
SQL Security
mysqli_connect()
- Connect to MySqul with datas.
- You should add host address, id, password, databse correctly as parameters.
mysqli_prepare()
- Create SQL query with formatting.
mysqli_stmt_bind_param()
- Fill sql query with the specific value.
- Each type has each character like
s
meansstring
.
mysqli_stmt_execute()
- Execute query.
mysqli_stmt_get_result()
- Get result from the query.
mysqli_num_rows()
- Get number of rows from the query result.
Don’t use mysqli_query()
- Because
mysqli_query()
is a week for the security. - For example, if email value is “’ or 1 = ‘1”, then it’s always true.
Blog
MySQL
Access to MySQL from Bash
mysql -u USERNAME -p PASSWORD
connects mysql by specific username and verify with the password.mysql -u root -p
can also run and you should enter password next line on bash.
Database
show databases;
return databases.CREATE DATABASE DATABASENAME;
creates new empty database with specific name.use DATABASENAME;
changes current database to specific database.
TABLE
CREATE TABLE TABLENAME();
creates table with specific name.- You can set columns with
()
. explain TABLENAME
returns the table with columns.
Settings
session.use_strict_mode
- with strict mode off, a user can decide which session ID she wants to use.
-
With strict mode on, the user can not decide that.
- php.ini
register_shutdown_function
- Registers a callback to be executed after script execution finishes or exit() is called.
session_set_cookie_params
- Set the session cookie parameters.
- First value is lifetime or options, so it should be always not null.
Style
transition-timing-function: cubic-bezier(P0, P1, P2, P3);
- A Cubic Bezier curve is defined by four points P0, P1, P2, and P3. P0 and P3 are the start and the end of the curve and, in CSS these points are fixed as the coordinates are ratios. P0 is (0, 0) and represents the initial time and the initial state, P3 is (1, 1) and represents the final time and the final state.
input:not([type=submit])
- The :not() class is a powerful CSS negation matcher.
-
For example,
li:not(.different)
would match all list items that don’t have the HTML class:.different
. - app.css
Layout
UIKit
- Installation: https://getuikit.com/docs/installation
- UIKit is UI Framework for Web.
CKEditor
- Installation: balloon-block editor
- Balloon block editor : Balloon block is essentially the balloon editor with an extra block toolbar which can be accessed using the button attached to the editable content area and following the selection in the document. The toolbar gives an access to additional, block–level editing features.