Skip to content

Instantly share code, notes, and snippets.

View minhphong306's full-sized avatar
😄
Don't watch the clock. Do what it does! Keep going!

Phong Do minhphong306

😄
Don't watch the clock. Do what it does! Keep going!
View GitHub Profile
<?php
$host = 'localhost';
$username = 'root';
$passwd = 'PhongDP25#*';
$dbname = 'online_shopping';
$conn = new mysqli($host, $username, $passwd, $dbname);
$query = "SELECT * FROM category order by name";
$data = $conn->query($query);
@minhphong306
minhphong306 / Đề bài
Last active October 8, 2017 11:30
Đề bài
Câu 1: Phân biệt giữa 2 phương thức GET và POST của form. Khi nào nên sử dụng phương thức nào?
Câu 2: Hãy cho biết phạm vi của biến trong PHP? Làm thế nào để đưa biến vào trong hàm?
Câu 3: SQL Injection là gì? Làm thế nào để tránh.
Câu 4: Cho DB và thông tin Server như hình dưới.
Yêu cầu:
- Category được hiển thị dưới dạng combobox, Product hiển thị dưới dạng lưới, cả 2 đều sắp xếp tăng dần
- Mục "Tất cả" được thêm vào đầu
@minhphong306
minhphong306 / Bài ̀4
Last active October 8, 2017 15:44
Giải bài tập PHP
<?php
$host = '192.168.43.99';
$username = 'root';
$passwd = 'root';
$dbname = 'shop';
$conn = new mysqli($host, $username, $passwd, $dbname);
$query = "SELECT * FROM category order by name";
$data = $conn->query($query);
@minhphong306
minhphong306 / HashJCA.java
Created November 30, 2017 07:20
Code some hash function in java: MD5, SHA-1, SHA-256
package network_security;
import java.math.BigInteger;
import java.security.MessageDigest;
/**
*
* @author Admin
*/
public class HashJCA {
@minhphong306
minhphong306 / SymetricCrypto.java
Created November 30, 2017 07:53
AES key generator (from string or none), encrypt and decrypt in java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package network_security;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
@minhphong306
minhphong306 / RSAKeyGen.java
Last active December 1, 2017 09:11
Class generate key RSA
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package onthi;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@minhphong306
minhphong306 / MahoaRSA.javav
Last active December 1, 2017 09:58
Class using RSA to encrypt, decrypt, compare MD5 hash, read and write file
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package onthi;
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
@minhphong306
minhphong306 / RSAMain.java
Last active December 1, 2017 09:59
Class main RSA
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package onthi;
import java.security.PrivateKey;
import java.security.PublicKey;
@minhphong306
minhphong306 / CDNs
Last active June 4, 2018 02:37
CDNs
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.7/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/1.0.3/angular-ui-router.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" >
//forEZcoppy
//forEZcoppy
@minhphong306
minhphong306 / bodau.php
Created January 9, 2018 04:24
Hàm bỏ dấu tiếng việt trong PHP
function vn_to_str ($str){
$unicode = array(
'a'=>'á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ',
'd'=>'đ',
'e'=>'é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ',