<?php
include_once('clsLibGTIN.php');
if(!isset($_GET['barcode']))
{
echo "0843163050105<br />";
echo 'clsLibGTIN::GTINCheck(\'0843163050105\', 1) returns: <stong>' . clsLibGTIN::GTINCheck('0843163050105', 1) . '</strong><br />';
echo 'clsLibGTIN::GTINCheck(\'0843163050105\') returns: <stong>' . clsLibGTIN::GTINCheck('0843163050105') . '</strong><br />';
}else{
echo '<p>Barcode check for: <strong>' . (string)$_GET['barcode'] . '</strong><br />';
echo 'This is a ' . (clsLibGTIN::GTINCheck($_GET['barcode']) ? '<span style="color: green">correct</span>' : '<span style="color: red">incorrect</span>'). ' barcode<br />
'.(clsLibGTIN::GTINCheck($_GET['barcode']) ? 'It is a: <strong>' . clsLibGTIN::GTINCheck($_GET['barcode'], false, 1) . '</strong> code (' . clsLibGTIN::GTINCheck($_GET['barcode']) . ')<br />It can be displayed as GTIN-14: ' . clsLibGTIN::GTINCheck($_GET['barcode'], true) : '').'</p>';
}
?>
<p>Add barcode and check the result:
<form name="input" action="example.php" method="get">
Barcode: <input type="text" name="barcode">
<input type="submit" value="Submit">
</form>
</p>
|