Skip to main content

Posts

Showing posts from February 24, 2022

PHP#29MySQL#25 - Captcha & Bình chọn

//CAPTCHA: vidu.php <?php session_start(); //phát sinh 6 ký tự ngẫu nhiên: $dodai=6; $chuoi="QWERTYUIOPASDFGHJKLZXCVBNM0123456789"; $capt=""; for($i=1;$i<=$dodai;$i++) { $vitri=rand(0,35); $capt.=substr($chuoi,$vitri,1); } $_SESSION['captcha']=$capt; ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <form action="xuly.php" name="form1"id="form1" method="post">   <p>     <label for="textfield">Ho Ten:</label>     <input type="text" name="textfield" id="textfield">   </p>   <p>     <label for="textfield2">Mat Khau:</label>     <input type="text" name="textfield2" id="textfield2">   </p>   <p>     <label for="textfield3">Nhap ma xac n...

PHP#28MySQL#24 - GIỎ HÀNG 3 (xong)

 //datbao.php <?php session_start(); if(!isset($_SESSION['giohang'])) $_SESSION['giohang']=array(); ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <form id="f" name="form1" method="post" action="xuly.php">   <p>Đăng Ký Đặt Báo      <p>     <label for="loaibao">Loại báo:</label>     <select name="loaibao" id="loaibao">     <?php  include("connect.php"); $sql="select * from loaibao"; $kq=mysqli_query($link,$sql); while($d=mysqli_fetch_array($kq)) { ?>       <option value="<?php echo $d['mabao'];?>"><?php echo $d['tenbao'];?></option>        <?php }?>     </select>   </p>   <p>     <label for="soluong">Số lượng:</lab...