Do you mean you want it to accept any numbers from 0000000000 to 9999999999?
Here is veeery custom script version, which is cut and heavily changed to support that (if I understood you correctly).
<?php
// show login form
function showLoginPasswordProtect($error_msg) {
?>
<html>
<head>
<title>Please enter password to access this page</title>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</head>
<body>
<style>
input { border: 1px solid black; }
</style>
<form method="post">
<h3>Please enter password to access this page</h3>
<font color="red"><?php echo $error_msg; ?></font><br />
<input type="password" name="access_password" maxlength="10" />
<p></p><input type="submit" name="Submit" value="Submit" />
</form>
</body>
</html>
<?php
die(); // stop at this point
}
// user provided password
if (isset($_POST['access_password'])) {
$pass = $_POST['access_password'];
if (strlen($pass) != 10 || !preg_match("/^[0-9]+$/",$pass) ) {
showLoginPasswordProtect("Incorrect password.");
}
else {
// set cookie if password was validated
setcookie("verify", "");
}
}
else {
// check if password cookie is set
if (!isset($_COOKIE['verify'])) {
showLoginPasswordProtect("");
}
}
?>