为什么PHP代码不读取输入框值

when i select a value on my dropdown table it will appear to my input box without a sumbit button. and now i just trying to pass the data i selected thru php and trying to "echo" it..uhmm my question is how can i pass it sory guys noob here :(

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang= "en">
<head>
<meta http-equiv= "Content-Type" content="text/html; charset=utf-8"> 
<title>first script</title>
<script type= "text/javascript">
onload= function(){
var sel= document.getElementsByName('selectScript')[0];
var inp= document.getElementsByName('txtScript')[0];
sel.onchange= function(){
    inp.value= sel.value;
}
}
</script>
</head>
<body> <h1>First Script</h1>
<form action="" onsubmit="return false" method="post">
<p>
<select name= "selectScript" size="1">
<option selected= "selected" value="30">PDS</option>
<option value= "28">EPS</option>

</select>
<input type= "text" name="txtScript" readonly="readonly">

</p>
</form>
</body>
</html>

<?php 
$a = ['txtScript'];
$pinili = $_POST['txtScript'];

echo $pinili;
?>

First, it's better to use something like AJAX if you want the user to stay on the same page and return a success message so that the user knows that the form went through.

But, if you're going to leave it as is you should remove:

 onsubmit="return false"

from your form.

I am also assuming that this page is in fact a PHP file i.e. index.php, contact.php or something to that extent or else you won't be able to see the result of PHP. If it is a PHP file and you do not see a returned result for something like:

<?php echo 'test'; ?> 

then you do not have PHP enabled on your server and you need to start there.

Updated:

<form action="" method="post">
<p>
<select name= "selectScript" size="1">
<option selected= "selected" value="30">PDS</option>
<option value= "28">EPS</option>
</select>
</p>
</form>
</body>
</html>
<?php 
$your_selected_value = $_POST['selectScript'];
echo $your_selected_value;
?>