Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require "header.php";
- ?>
- <?php
- if ($_POST["Create"] === "submit") {
- $name = preg_match("/[A-Z][a-z]+/",$_POST["name"]);
- $tel = preg_match("/\d{10}/", $_POST["phone"]);
- $email = preg_match("/\w+@(gmail||yahoo).com/", $_POST["email"]);
- $pass = strcmp($_POST["password"], $_POST["rpassword"]);
- if($name == 0) {
- $_POST["name"] = "Incorrect name";
- }
- if($tel == 0) {
- $_POST["phone"] = "Incorrect phone number";
- }
- if($email == 0) {
- $_POST["email"] = "Incorrect email";
- }
- }
- ?>
- <div class="login_box" id="cr_acc_box:">
- <form action = "create_account.php" method = "POST">
- <fieldset>
- <legend>Create account:</legend>
- Name: <input type = "text" name = "name" value = "<?php echo $_POST["name"]?>"> <br><br>
- Username: <input type = "text" name = "Username" value = "<?php echo $_POST["Username"]?>"> <br><br>
- Telephone number: <input type="text" name="phone" value = "<?php echo $_POST["phone"]?>"> <br><br>
- E-mail: <input type="text" name="email" value="<?php echo $_POST["email"]?>"><br><br>
- Password: <input type="password" name="password" value="<?php echo $_POST["password"]?>"><br><br>
- Retype password: <input type="password" name="rpassword" value="<?php echo $_POST["rpassword"]?>"><br><br>
- <span id="submit"><input type="submit" name="Create" value="submit"></span>
- </fieldset>
- </form>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement