×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: ActionScript
Posted by: Ron McCain
Added: May 6, 2015 7:44 AM
Views: 1894
Tags: no tags
  1. <?php
  2. /**
  3.  * Register.php
  4.  *
  5.  * Displays the registration form if the user needs to sign-up,
  6.  * or lets the user know, if he's already logged in, that he
  7.  * can't register another name.
  8.  *
  9.  * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
  10.  * Last Updated: August 2, 2009 by Ivan Novak
  11.  */
  12. include '../php_include/advads_header-inc.php';
  13. include '../login_admin/include/session.php';
  14. ?>
  15.  
  16. <html>
  17. <head>
  18.         <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  19.         <title>ADVENTURES Login Page</title>
  20.         <link rel="stylesheet" href="-css/style.css" type="text/css" />
  21.         <link rel="stylesheet" href="-css/flat_box.css" type="text/css" />
  22.         <link rel="stylesheet" href="-css/960/reset.css" type="text/css" />
  23.         <link rel="stylesheet" href="-css/960/960.css" type="text/css" />
  24.         <link rel="stylesheet" href="-css/960/text.css" type="text/css" />     
  25. </head>
  26. <body>
  27. <div class="container">
  28.  
  29.   <section id="content">
  30. <?php
  31. /**
  32.  * The user is already logged in, not allowed to register.
  33.  */
  34. if($session->logged_in){
  35.    echo "<h1>Registered</h1>";
  36.    echo "<p>We're sorry <b>$session->username</b>, but you've already registered. "
  37.        ."<a href=\"main.php\">Main</a>.</p>";
  38. }
  39. /**
  40.  * The user has submitted the registration form and the
  41.  * results have been processed.
  42.  */
  43. else if(isset($_SESSION['regsuccess'])){
  44.    /* Registration was successful */
  45.    if($_SESSION['regsuccess']){
  46.       echo "<h1>Registered!</h1>";
  47.       if(EMAIL_WELCOME){
  48.          echo "<p>Thankyou <b>".$_SESSION['reguname']."</b>, you have been sent a confirmation email which should be arriving shortly.  Please confirm your registration before you continue.<br />Back to <a href='main.php'>Main</a></p>";
  49.       }else{
  50.       echo "<p>Thank you <b>".$_SESSION['reguname']."</b>, your information has been added to the database, "
  51.           ."you may now <a href=\"main.php\">log in</a>.</p>";
  52.       }
  53.    }
  54.    /* Registration failed */
  55.    else{
  56.       echo "<h1>Registration Failed</h1>";
  57.       echo "<p>We're sorry, but an error has occurred and your registration for the username <b>".$_SESSION['reguname']."</b>, "
  58.           ."could not be completed.<br>Please try again at a later time.</p>";
  59.    }
  60.    unset($_SESSION['regsuccess']);
  61.    unset($_SESSION['reguname']);
  62. }
  63. /**
  64.  * The user has not filled out the registration form yet.
  65.  * Below is the page with the sign-up form, the names
  66.  * of the input fields are important and should not
  67.  * be changed.
  68.  */
  69. else{
  70. ?>
  71.  
  72. <h1>Register</h1>
  73. <?php
  74. if($form->num_errors > 0){
  75.    //echo "<font size=\"1\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>";
  76. }
  77. ?>
  78. <div id="register">
  79.         <form action="process.php" method="POST">
  80.                
  81.         <!--          ======================FIRST NAME==========================================      -->    
  82.             <p class="textinput">First Name: </p>
  83.                
  84.                 <p>
  85.                    
  86.                     <input  type="text" name="first_name" maxlength = "30" size="10" value="<?php echo $form->value("first_name"); ?>">
  87.                    
  88.                    
  89.                 </p>
  90.                    
  91.                    
  92.               <p class="showerr">  
  93.                      
  94.                     <?php echo $form->error("first_name"); ?>
  95.                
  96.              </p>
  97. <!--          ======================LAST NAME==========================================      -->
  98.                            
  99.                <p class="textinput">Last Name: </p>
  100.            
  101.                <p>
  102.                   <input type="text" name="last_name" maxlength="30" value="<?php echo $form->value("last_name"); ?>">
  103.                    
  104.               </p>
  105.                  
  106.                  
  107.               <p class="showerr">
  108.                          
  109.                     <?php echo $form->error("last_name"); ?>
  110.                
  111.                    </p>  
  112.                
  113.         <!--          ======================ADDRESS==========================================      -->        
  114.                    
  115.                     <p class="textinput">Address: </p>
  116.            
  117.                <p>
  118.                   <input type="text" name="address" maxlength="30" value="<?php echo $form->value("address"); ?>">
  119.                    
  120.               </p>
  121.                  
  122.                  
  123.               <p class="showerr">
  124.                          
  125.                     <?php echo $form->error("address"); ?>
  126.                
  127.                    </p>  
  128.                
  129.                    
  130.        <!--          ======================CITY==========================================      -->        
  131.                    
  132.                     <p class="textinput">City: </p>
  133.            
  134.                <p>
  135.                   <input type="text" name="cityname" maxlength="30" value="<?php echo $form->value("cityname"); ?>">
  136.                    
  137.               </p>
  138.                  
  139.                  
  140.               <p class="showerr">
  141.                          
  142.                     <?php echo $form->error("cityname"); ?>
  143.                
  144.                    </p>  
  145.                
  146.                    
  147.          <!--          ======================STATE==========================================      -->          
  148.                    
  149.                        <p class="textinput">State: </p>
  150.            
  151.                <p>
  152.                   <input type="text" name="statename" maxlength="30" value="<?php echo $form->value("statename"); ?>">
  153.                    
  154.               </p>
  155.                  
  156.                  
  157.               <p class="showerr">
  158.                          
  159.                     <?php echo $form->error("statename"); ?>
  160.                
  161.                    </p>  
  162.                    
  163.                    
  164.         <!--          ======================ZIP CODE==========================================      -->          
  165.                    
  166.                        <p class="textinput">Zip Code: </p>
  167.            
  168.                <p>
  169.                   <input type="text" name="zipcode" maxlength="30" value="<?php echo $form->value("zipcode"); ?>">
  170.                    
  171.               </p>
  172.                  
  173.                  
  174.               <p class="showerr">
  175.                          
  176.                     <?php echo $form->error("zipcode"); ?>
  177.                
  178.                    </p>  
  179.                    
  180.       <!--          ======================PHONE=========================================      -->          
  181.                    
  182.                        <p class="textinput">Phone: </p>
  183.            
  184.                <p>
  185.                   <input type="text" name="phone" maxlength="30" value="<?php echo $form->value("phone"); ?>">
  186.                    
  187.               </p>
  188.                  
  189.                  
  190.               <p class="showerr">
  191.                          
  192.                     <?php echo $form->error("phone"); ?>
  193.                
  194.                    </p>  
  195.                                  
  196.          
  197.                    
  198.                    
  199. <!--          ======================USER NAME==========================================      -->    
  200.                
  201.                 <p class="textinput">Username: </p>
  202.                
  203.                 <p>
  204.                    
  205.                     <input type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>">
  206.                    
  207.                     <?php echo $form->error("user"); ?>
  208.                 </p>
  209.                
  210.                 <p class="textinput">Password: </p>
  211.                
  212.                 <p>
  213.                    
  214.                     <input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>">
  215.                    
  216.                     <?php echo $form->error("pass"); ?>
  217.                    
  218.      <!--          ======================EMAIL==========================================      -->                  
  219.                    
  220.        
  221.                 </p>
  222.                
  223.                 <p class="textinput">Email: </p>
  224.                
  225.                 <p>
  226.                     <input type="text" name="email" maxlength="50" value="<?php echo $form->value("email"); ?>">
  227.                     <?php echo $form->error("email"); ?>
  228.                 </p>
  229.                
  230.                 <p class="textinput">
  231.                    
  232.                     <input type="hidden" name="subjoin" value="1"><input type="submit" value="Register">
  233.                 </p>
  234.                
  235.                 <p>
  236.                     <a href="main.php">[Back to Main]</a>
  237.                 </p>
  238.         </form>
  239. </div>
  240. </section>
  241. <?php
  242. }
  243. ?>
  244.  
  245. </div>
  246. </body>
  247. </html>
  248.