Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php session_start(); ?>
- <?php
- //check if the user is logged in
- if (isset($_SESSION['validuser'])) {
- echo 'already a member';
- //catch this first - before user spends time filling out the 12 fields!
- //send to message page saying "you cannot register - you are already a member and logged in"
- //WORKING PERFECTLY - CONFIRMS FORM POSTING TO SAME PAGE CORRECTLY!
- //time for other checks....
- }
- elseif (isset($_POST['submit'])) {
- echo 'new user posted';
- //if there is no logged in user and form has been submitted, start checking the fields to see if any fields are empty
- //collect all errors in array and display?
- //direct back to the form with appropriate messages, form fields retained
- //exit here? or no?
- //focus now has to pass to the form again - need any code for this? or will it happen automatically?
- }
- ?>
- <html>
- <body>
- <form action="?" method = "POST">
- <!-- 12 fields to be filled out by user -->
- <input type = "submit" name = "submit" value = "submit" />
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement