Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = htmlspecialchars($_POST['username']);
- if (preg_match("/\s/",$username))
- {
- die("do not use spaces, tabs or newlines in your username");
- }
- $email = htmlspecialchars($_POST['email']);
- if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email))
- {
- die("Invalid E-mail address");
- }
- $Password = htmlspecialchars($_POST['password']);
- if (preg_match("/\s/",$Password))
- {
- die("do not use spaces, tabs or newlines in your password");
- }
- ?>
- <html>
- <body>
- Your name is: <?php echo $username; ?><br />
- Your password is: <?php echo $Password; ?><br />
- Your e-mail: <?php echo $email; ?><br />
- <?php echo "Please remember your details for future registration"; ?><br />
- <br />
- </body>
- </html>
- <?php
- function check_input($data)
- {
- $data = trim($data);
- $data = stripslashes($data);
- $data = htmlspecialchars($data);
- if ($problem && strlen($data) == 0)
- {
- die($problem);
- }
- return $data;
- }
- function show_error($anyError)
- {
- ?>
- <html>
- <body>
- <b>Please correct the following errors:</b><br />
- <?php echo $myError; ?>
- </body>
- </html>
- <?php
- exit();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement