Advertisement
Guest User

Untitled

a guest
Aug 10th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.20 KB | None | 0 0
  1. <?php session_start(); ?>
  2.     <?php
  3.     //check if the user is logged in
  4.     if (isset($_SESSION['validuser'])) {
  5.           echo 'already a member';
  6.           //catch this first - before user spends time filling out the 12 fields!
  7.           //send to message page saying "you cannot register - you are already a member and     logged in"
  8.           //WORKING PERFECTLY - CONFIRMS FORM POSTING TO SAME PAGE CORRECTLY!
  9.           //time for other checks....
  10.     }
  11.     elseif (isset($_POST['submit'])) {
  12.           echo 'new user posted';
  13.           //if there is no logged in user and form has been submitted, start checking the fields to see if any fields are empty
  14.           //collect all errors in array and display?
  15.           //direct back to the form with appropriate messages, form fields retained
  16.           //exit here? or no?
  17.           //focus  now has to pass to the form again - need any code for this? or will it happen automatically?
  18.     }
  19.  
  20.     ?>
  21.     <html>
  22.        <body>
  23.         <form action="?" method = "POST">
  24.             <!--  12 fields to be filled out by user     -->
  25.             <input type = "submit" name = "submit" value = "submit" />
  26.         </form>
  27.         </body>
  28.     </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement