Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>GSM</title>
- </head>
- <body bgcolor="#99ffcc">
- <h2>GSM номер валидатор</h1>
- <form action="#" method="post">
- <label for="gsm">GSM: </label>
- <input type="text" name="gsm">
- <input type="submit" name="validate" value="Валидирай">
- </form>
- <?php
- if (isset($_POST["validate"])){
- $gsm = $_POST["gsm"];
- $regexGsm = "/^(0|(\+359))8[7-9][0-9]{7}$/";
- if (preg_match($regexGsm, $gsm)){
- echo "<p>".$gsm." е валиден GSM номер</p>";
- } else {
- echo "<p>Невалиден GSM номер</p>";
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement