<?php
// Include the database connection file
session_start();
include "menuadmin.php";
include 'config.php';


if (isset($_POST['update'])) 
{
	$kodeuser=$_POST['ikduser'];
    $nama=addslashes($_POST['inama']);
	$smt=addslashes($_POST['ismt']);
	
	
	

		// Update the database table
		$result = mysqli_query($mysqli, "UPDATE `tapel` SET `nama`='$nama',`semester`='$smt' WHERE `Idtapel`='$kodeuser'");
		
		// Display success message
		echo "<p><font color='green'>Data updated successfully!</p>";
		echo "<br> ";
		header("location:tapel.php?ed=1");
		
	}
