topical media & game development
[] readme course(s) preface I 1 2 II 3 4 III 5 6 7 IV 8 9 10 V 11 12 afterthought(s) appendix reference(s) example(s) resource(s) _

talk show tell print

portal-cms-login.php



  <?php 
  include(<config.php>);
  login = _GET['login'];
  username = _POST['username'];
  password = _POST['password'];
  
  if (login == true) {
          
                  password         =         md5(password);        
                  query_userLogin         =         "SELECT * 
                                                                  FROM admins 
                                                                  WHERE admin_username = '".username."'
                                                                  AND        admin_password = '".password."';";
  
                  userLoginResults = mysql_query(query_userLogin);
                  row = mysql_fetch_array(userLoginResults);
                  if (row['admin_username'] != NULL) {
                  
                          Hour = 3600 + time(); //this adds 1 hour to the current time 
                          setcookie("admin_Id", row['admin_id'], Hour);
                          header('Location: index2.php');
                          
                          } else {
          
                          header('Location: index.php');
          
                          }
                  }
  
  ?>


(C) A. Eliëns 2/9/2007

You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.