|
Connection.php dastur kodidan namuna
|
bet | 10/10 | Sana | 26.07.2024 | Hajmi | 2,55 Mb. | | #268679 |
Bog'liq BMI6.Connection.php dastur kodidan namuna:
$server = ‘localhost’;
$username = ‘root’;
$password = ‘‘;
$database = ‘login_register_db’;
if (isset($_POST))
$conn = new mysqli($server, $username, $password, $database);
if ($conn) {
} else {
die(mysqli_error($conn));
}
7.Add.php dastur kodidan namuna:
include_once(‘connection.php’);
if(isset($_POST[‘register’])){
$name=$_POST[‘name’];
$username=$_POST[‘username’];
$pass=md5($_POST[‘password’]);
$sql ="INSERT INTO `tbl_user`(`name`, `username`, `password`) VALUES (‘$name’,’$username’,’$pass’)";
$result=mysqli_query($conn,$sql);
if($result){
header(‘location:index1.php’);
echo"";
}else{
die(mysqli_error($conn)) ;
}
|
| |