Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $local = 'localhost';
- $loginbd = 'root';
- $passbd = 'root';
- $namebd = 'crm';
- $link = mysqli_connect($local,$loginbd,$passbd,$namebd);
- if($_SESSION['auto'] === true){
- include "html/add_client.html";
- $name = $_POST['name'];
- $surname = $_POST['surname'];
- $patronymic = $_POST['patronymic'];
- $number = $_POST['number'];
- $email = $_POST['email'];
- $address = $_POST['address'];
- $description = $_POST['description'];
- if(!empty($name) && !empty($surname)){
- $query = mysqli_query($link,"INSERT INTO clients SET name='$name',surname='$surname',patronymic='$patronymic',number='$number',email='$email',address='$address',description='$description'") or die(mysqli_error($link));
- header("Location:/main");
- } else {
- if(!empty($_POST)){
- echo "Please enter name and surname client";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement