This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fileName = $file['name']; | |
$fileUploadTmp = $file['tmp_name']; | |
$fileType = $file['type']; | |
$fileError = $file['error']; | |
$fileContent = file_get_contents($file['tmp_name']); | |
$extension = strtoupper(pathinfo($fileName, PATHINFO_EXTENSION)); | |
$allowFiles = ['XLSX', 'CSV']; | |
// check upload is ok | |
if ($fileError) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- phpMyAdmin SQL Dump | |
-- version 4.9.7 | |
-- https://www.phpmyadmin.net/ | |
-- | |
-- Máy chủ: localhost:8889 | |
-- Thời gian đã tạo: Th10 06, 2021 lúc 06:55 AM | |
-- Phiên bản máy phục vụ: 5.7.32 | |
-- Phiên bản PHP: 7.4.12 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get an instance of the WC_Order Object from the Order ID (if required) | |
$order = wc_get_order($order_id); | |
// Get the Customer ID (User ID) | |
$customer_id = $order->get_customer_id(); // Or $order->get_user_id(); | |
// Get the WP_User Object instance | |
$user = $order->get_user(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name domain.com www.domain.com; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Lấy địa chỉ ip của client | |
*/ | |
protected function get_client_ip() | |
{ | |
$ipaddress = ''; | |
if (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP']) { | |
$ipaddress = $_SERVER['HTTP_CLIENT_IP']; | |
} else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']) { | |
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: mariohandsome.github.io | |
#!/bin/bash | |
SERVER_NAME="SERVER_NAME" # folder name in cloud | |
BLACK_LIST=( "source_in_git" "source_in_git_02" ) # folder not upload | |
TIMESTAMP=$(date +"%F") | |
BACKUP_DIR="/root/backup/$TIMESTAMP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* convert from https://freetuts.net/tao-slug-tu-dong-bang-javascript-va-php-199.html | |
* @param string str | |
* @return string | |
*/ | |
const convertToSlug = function(str) { | |
let title, slug | |
//Đổi chữ hoa thành chữ thường | |
slug = str.toLowerCase() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('memory_limit', -1); | |
ini_set('max_execution_time', 0); | |
ini_set("display_errors", 1); | |
ini_set("display_startup_errors", 1); | |
error_reporting(E_ALL); | |
date_default_timezone_set(DefaultValue::$Location); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ServerName `YOURSERERIP - 192.123.16.789` | |
# Listen `YOURPORT - 4200` | |
<VirtualHost `DOMAIN - YOURDOMAIN.COM`:*> | |
ServerAdmin `YOURE MAIL - yourmai@email.com` | |
ServerName `DOMAIN - YOURDOMAIN.COM` | |
ServerAlias `DOMAIN - YOURDOMAIN.COM` | |
ProxyRequests Off | |
ProxyVia Full |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable Compression | |
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject | |
AddOutputFilterByType DEFLATE application/x-font | |
AddOutputFilterByType DEFLATE application/x-font-opentype | |
AddOutputFilterByType DEFLATE application/x-font-otf | |
AddOutputFilterByType DEFLATE application/x-font-truetype | |
AddOutputFilterByType DEFLATE application/x-font-ttf | |
AddOutputFilterByType DEFLATE font/opentype | |
AddOutputFilterByType DEFLATE font/otf |
NewerOlder