function myfun()
{
var nm=12;
window.location.href="bkd.php?uid="+nm;
}
<form name="frm" method="GET">
<input type="text" value="ghf" onclick="myfun();"></input>
<input type="hidden" value="" name="txtval" id="txtval"></input>
<?php
echo $_GET["uid"];
?>
</form>
I have added JS and HTML on the same page. Wwhen I execute the code I am getting the value in PHP but it also displays
"Undefined index: uid"