$_GET['name'] -> This line of code is not working as expected
HTML + PHP in one single file
<form action="" method="GET">
<input onkeyup="onAnyInput(this,'nameTD');" class="w3-input" type="text" name="name" value="<?php echo $f_name ?>">
<a class="w3-button w3-green" href='updateEmployee.php?sr_no=<?php echo $sr_no ?>&update=true'>Update</a>
</form>
<?php
if (isset($_GET['update'])) {
updateEmployee();
}
function updateEmployee() {
global $newName;
$newName = $_GET['name']; //this line is not working
}
?>