Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // ^X?[\d]{5}[ ]*\-[ ]*[\d]{2}$ ID
- // ^[A-Z]{1}[\w]+([ ]+[\w]{2,})?$ Jmeno
- // ^[\d]+[ ]+((KČ)|(kč)|(Kč)|(kČ))$
- if (isset($_GET["ID"])) $id = $_GET["ID"];
- if (isset($_GET["Jmeno"])) $jmeno = $_GET["Jmeno"];
- if (isset($_GET["Cena"])) $cena = $_GET["Cena"];
- if (preg_match("/^X?[\d]{5}[ ]*\-[ ]*[\d]{2}$/", $id) != 1)
- {
- echo "Spatne ID !";
- }
- if (preg_match("/^[A-Z]{1}[\w]+([ ]+[\w]{2,})?$/", $jmeno) != 1)
- {
- echo "Spatne jmeno !";
- }
- if (preg_match("/^[\d]+[ ]+((KČ)|(kč)|(Kč)|(kČ))$/", $cena) != 1)
- {
- echo "Spatna cena !";
- }
- echo "<form method='get'>";
- echo "<table cellpadding='5'>";
- echo "<tr><td>ID</td><td><input type='text' name='ID'></td></tr>";
- echo "<tr><td>Jméno</td><td><input type='text' name='Jmeno'></td></tr>";
- echo "<tr><td>Cena</td><td><input type='text' name='Cena'></td></tr>";
- echo "</table>";
- echo "<input type='submit' value='Odeslat'>";
- echo "</form>";
- ?>
Add Comment
Please, Sign In to add comment