LOADING ..

New Page

 

- Ancestry access

"> Enter your Card Number to Gain Access

In order to use the online resource you have chosen, you must authenticate as a card holder. After you submit and are successfully verified, click on the link and it will take you to the desired website.

Patron Library Card #: *



 

<!DOCTYPE HTML>
<html>
<head>
<style>
.error {color: #FF0000;}
</style>
</head>
<body>

<?php
// define variables and set to empty values
$cardnumErr = "";
$cardnum = "";
$ancestryURL = "";
$ancestryMsg = "";
$library = "Crandall Public Library";

if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["cardnum"])) {
$cardnumErr = "Library card number is required";
} else {
$cardnum = test_input($_POST["cardnum"]);
// check if valid card
if (!preg_match("/^[1][0][0][0][5][0-9]{8}$/",$cardnum)) {
$cardnumErr = "Please enter your library card number";
}
else {
$ancestryMsg= '<h2>Click on the link below to go to the Ancestry: Library Edition informational website.</h2>';
$ancestryURL= '<a href="ANCESTRY-URL-HERE">Ancestry: Library edition</a>';
}
}

}

function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>

<h2><?php echo $library ?> - Ancestry access</h2>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<fieldset>
<legend>Enter your Card Number to Gain Access</legend>
<p>In order to use the online resource you have chosen, you must authenticate as a <?php echo $library ?> card holder. After you submit and are successfully verified, click on the link and it will take you to the desired website.</p>
<label for="LBLcardnum">Patron Library Card #:</label>
<input type="text" size="40" name="cardnum" id="cardnum" />
<span class="error">* <?php echo $cardnumErr;?></span>
<!--<p><span class="error">* required field</span></p>--><br /><br />
<input type="submit" name="submit" value="Submit Card Number" />
</fieldset>
</form>

<?php
echo $ancestryMsg;
echo $ancestryURL;

?>

</body>
</html>