Trần Văn Điệp
Trần Văn Điệp
15:10 04/04/2019
Mọi Thành Viên   EJB (EAD)  

luong van ngoc
luong van ngoc
20:34 25/03/2019

Cho em code khóa học lập trình javascript

Mọi Thành Viên  

Trần Văn Điệp
Trần Văn Điệp
20:34 25/03/2019
Hiện tại a không lưu lại code của từng video nên không thể gửi cho em đc. Chỉ video nào a có attach code thì mới có thôi.

Trần Văn Điệp
Trần Văn Điệp
09:43 10/09/2018

Object & Array in PHP


<?php
if (!empty($_POST)) {
	$username = $_POST['username'];
	$email    = $_POST['email'];
	$password = $_POST['password'];

	if ($username != "" && $password != "") {
		//set data into cookie
		setcookie("username", $username, time()+7*24*60*60, "/");
		setcookie("email", $email, time()+7*24*60*60, "/");
		setcookie("password", $password, time()+7*24*60*60, "/");

		header('Location: login.php');
		die();
	}
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<title>PHP tutorial</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
	<div class="panel panel-primary">
		<div class="panel-body">
			<form method="post">
				<div class="form-group">
					<label>User Name</label>
					<input type="text" name="username" class="form-control">
				</div>
				<div class="form-group">
					<label>Password</label>
					<input type="password" name="password" class="form-control">
				</div>
				<div class="form-group">
					<label>Email</label>
					<input type="email" name="email" class="form-control">
				</div>
				<button class="btn btn-success">Register</button>
			</form>
		</div>
	</div>
</div>
</body>
</html>


Mọi Thành Viên   Khoá Học PHP Căn Bản  

Trần Văn Điệp
Trần Văn Điệp
19:56 16/08/2018

<?php
session_start();
require_once('process_add_product.php');
?>

<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="panel panel-primary">
			<div class="panel-heading">
				Input Product's Details Information
			</div>
			<div class="panel-body">
				<form method="post">
				<div class="form-group">
					<label>Product Name:</label>
					<input class="form-control" type="text" name="product" id="product">
				</div>
				<div class="form-group">
					<label>Price:</label>
					<input class="form-control" type="number" name="price" id="price">
				</div>
				<div class="form-group">
					<label>Quantity:</label>
					<input class="form-control" type="number" name="quantity" id="quantity">
				</div>
				<button class="btn btn-success" id="btn_add" type="submit">Add Product</button>
				<button class="btn btn-warning" type="reset">Reset</button>
				</form>
			</div>
		</div>
		<div class="panel panel-primary">
			<div class="panel panel-heading">
				Management Products
			</div>
			<div class="panel-body">
				<table class="table table-hover table-bordered">
					<thead>
						<th>No</th>
						<th>Product Name</th>
						<th>Price</th>
						<th>Quantity</th>
					</thead>
					<tbody id="dataList">
<?php
//MO KET NOI
$con = mysqli_connect("localhost", "root", "", "gokisoft");
mysqli_set_charset($con, 'utf8');

//TAO QUERY INSERT/UPDATE/DELETE/SELECT
$query = "SELECT * FROM PRODUCT";
$result = mysqli_query($con, $query);
// var_dump($result);
while($row = mysqli_fetch_array($result, 1)) {
	echo '<tr>
		<td>'.$row['ID'].'</td>
		<td>'.$row['PRODUCT'].'</td>
		<td>'.$row['PRICE'].'</td>
		<td>'.$row['QUANTITY'].'</td>
	</tr>';
}
//DONG KET NOI
mysqli_close($con);
?>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</body>
</html>



<?php
if(!empty($_POST)) {
	$product = $_POST['product'];
	$price = $_POST['price'];
	$quantity = $_POST['quantity'];

	//MO KET NOI
	$con = mysqli_connect("localhost", "root", "", "gokisoft");
	mysqli_set_charset($con, 'utf8');

	//TAO QUERY INSERT/UPDATE/DELETE/SELECT
	$query = "INSERT INTO PRODUCT(PRODUCT, PRICE, QUANTITY) VALUES ('$product', $price, $quantity)";
	mysqli_query($con, $query);

	//DONG KET NOI
	mysqli_close($con);
}


Mọi Thành Viên   Khoá Học PHP Căn Bản  

Đã sao chép!!!