PageRenderTime 42ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/index.php

https://github.com/Bryan-Rose/Form-Authenticator
PHP | 33 lines | 22 code | 3 blank | 8 comment | 3 complexity | 2fef76d99e4ed28d296f0367340b04a8 MD5 | raw file
  1. <?php
  2. // Trevor Mullins
  3. // CS350
  4. // index.php
  5. // Main Homepage
  6. session_start();
  7. $title = "Clarkson University:Home";
  8. if(!$_SESSION['loggedin']) {
  9. // User isn't Logged In, make them
  10. header("location: login.php");
  11. }
  12. include 'header.php';
  13. //print_r($_SESSION);
  14. // "import" the file needed to setup a database connection
  15. require_once("functions/dbConnect.php");
  16. // "import" functions a user would need
  17. require_once("functions/userFunctions.php");
  18. echo '
  19. <div id="main"><center>
  20. <p>'.printStats($_SESSION["username"]).'</p><br />
  21. <a href="newForm.php">New Form</a><br />';
  22. if($_SESSION["clearance"] >= 2) {
  23. echo '<a href="viewForms.php?username='.$_SESSION["username"].'&advisor=yes">Form Status</a>';
  24. } else {
  25. echo '<a href="viewForms.php">Form Status</a>';
  26. }
  27. echo '<br /></center></div>';
  28. require_once("functions/dbClose.php");
  29. include 'footer.php';
  30. ?>