Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include'structure/head.php';
- include'structure/nav.php';
- require_once 'config.php' ;
- require_once 'db_class.php' ;
- $connection = new dbController;
- $connection->dbConnect(HOST,USER,PASS,DB);
- if (!isset($_POST['submit'])) {
- echo "Unauthorised Access";
- }
- else {
- $id = $_POST['carid'];
- $description = $_POST['description'];
- $caption = $_POST['caption'];
- $image = 'images/'.$_FILES['image']['name'];
- $type = $_POST['type'];
- $model = $_POST['model'];
- $colour = $_POST['colour'];
- if ($_FILES['image']['error']==4) {
- $sql = "update cars set description='$description', caption='$caption', type='$type', model='$model', colour='$colour' where carid=$id";
- }
- else {
- $sql = "update cars set description='$description'', image='$image', caption='$caption', type='$type', model='$model', colour='$colour' where carid=$id";
- $connection->uploadImage($temp,$image);
- }
- if($connection->insertRecord($sql)) {
- echo "<br><br>";
- echo "<b class='suc'>Successfully updated record.</b>";
- }
- else {
- echo "<br><br>";
- echo "<b class='del'>Unsuccessfully updated record.</b>";
- }
- }
- include'structure/footer.php';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement