Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- ?>
- <a href="/main"><-Back</a>
- <?php
- $local = 'localhost';
- $loginbd = 'root';
- $passbd = 'root';
- $namebd = 'crm';
- $link = mysqli_connect($local,$loginbd,$passbd,$namebd);
- $id = $_GET['id'];
- $query = mysqli_query($link,"SELECT * FROM clients WHERE id='$id'");
- $client = mysqli_fetch_assoc($query);
- if(!empty($_POST)){
- $name = $_POST['name'];
- $surname = $_POST['surname'];
- $patronymic = $_POST['patronymic'];
- $number = $_POST['number'];
- $email = $_POST['email'];
- $address = $_POST['address'];
- $description = $_POST['description'];
- $query = mysqli_query($link,"UPDATE clients SET name='$name',surname='$surname',patronymic='$patronymic',number='$number',email='$email',address='$address',description='$description' WHERE id='$id'");
- header("Refresh:0");
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Add client</title>
- </head>
- <body>
- <form action="" method="post">
- <input name="name" placeholder="Name" value="<?php echo $client['name']?>"></br>
- <input name="surname" placeholder="Surname" value="<?php echo $client['surname']?>"></br>
- <input name="patronymic" placeholder="Patronymic" value="<?php echo $client['patronymic']?>"></br>
- <input name="number" placeholder="Number" value="<?php echo $client['number']?>"></br>
- <input name="email" placeholder="Email" value="<?php echo $client['email']?>"></br>
- <input name="address" placeholder="Address" value="<?php echo $client['address']?>"></br>
- <input name="description" placeholder="Description" value="<?php echo $client['description']?>"></br>
- <input type="submit"></br>
- </form>
- <a href="/main">Back</a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement