<?php
    session_start();     
    include('connection.php');

            $id=$_SESSION['id'];
            $vards=$_POST['vards'];
            $uzvards=$_POST['uzvards'];
            $lietotajvards=$_POST['lietotajvards'];
            $parole=$_POST['parole'];


            $sql = "update users set vards='$vards', uzvards='$uzvards', username='$lietotajvards', password='$parole' where id=".$id."" ;
            if ($con->query($sql) === TRUE) {
                header('Location: profile.php');
                echo '<script>alert("Profila informācija ir saglabāta")</script>';
              } else {
                $error="";
                echo "Error: " . $sql . "<br>" . $con->$error;
              }
    
              $con->close();
    

?>