<?php
session_start();
// store session data
$_SESSION['views']=1;
?>
<script>
function replaceNotNumber(hehe)
{
var pattern = /[^0-9]/g;
if(pattern.test(hehe.value))
{
hehe.value = hehe.value.replace(pattern,"");
}
}
</script>
<html>
<body>
<input type = "text" value="input your name here!" onpropertychange="replaceNotNumber(this)" οninput="replaceNotNumber(this)"/>
</body>
</html>