Advertisement
Guest User

Untitled

a guest
Feb 12th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.79 KB | None | 0 0
  1. <?php
  2. define('DB_HOST', 'localhost');
  3. define('DB_NAME', 'university portal');
  4. define('DB_USER','root');
  5. define('DB_PASSWORD','password007');
  6.  
  7. $con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die("Failed to connect to MySQL: " . mysql_error());
  8. $db=mysql_select_db(DB_NAME,$con) or die("Failed to connect to MySQL: " . mysql_error());
  9. /*
  10. $ID = $_POST['user'];
  11. $Password = $_POST['pass'];
  12. */
  13. function SignIn()
  14. {
  15. session_start(); //starting the session for user profile page
  16. if(!empty($_POST['UserName'])) //checking the 'user' name which is from Sign-In.html, is it empty or have some text
  17. {
  18. $query = mysql_query("SELECT Username, Password, voting_status FROM voters where Username = '$_POST[UserName]' AND Password = '$_POST[password]'") or die(mysql_error());
  19. $row = mysql_fetch_array($query) or die(mysql_error());
  20. if(!empty($row['Username']) AND !empty($row['Password']))
  21. {
  22.  
  23. $_SESSION['Username'] = $row['Password'];
  24. $_SESSION['Voting Status'] = $row['voting_status'];
  25. header("location:Voters Account.php");
  26.  
  27. }
  28. else{
  29. echo "username or password is incorrect";
  30. }
  31. }
  32. }
  33. if(isset($_POST['submit']))
  34. {
  35. SignIn();
  36. }
  37. ?>
  38.  
  39. <!doctype html>
  40. <html>
  41. <head>
  42. <link href="css/Layout.css" rel="stylesheet" type="text/css" />
  43. <link href="css/Menu.css" rel="stylesheet" type="text/css" />
  44. <meta charset="utf-8">
  45. <title>Student Welcome</title>
  46.  
  47. <link rel="stylesheet" href="themes/bar/bar.css" type="text/css" media= "screen" />
  48. <link rel="stylesheet" href="nivo-slider.css" type= "text/css" media="screen" />
  49. <script src="jquery.min.js" ></script>
  50. <script type="text/javascript" src="jquery.nivo.slider.js" ></script>
  51. </head>
  52.  
  53. <body>
  54. <div id="Holder">
  55. <div id="Header">
  56. <a href="Home.php"><img src="assets/Logo.png"></a>
  57. </div>
  58. <div id="NavBar">
  59. <nav>
  60. <ul>
  61. <li><a href="Home.php">Home</a></li>
  62. <li><a href="Login.php">Student Portal</a>
  63. <ul>
  64. <li><a href="Login.php">Login</a></li>
  65. <li><a href="Candidate Profile.php">Candidates Profile</a></li>
  66. </ul>
  67. </li>
  68. <li><a href="Admin.php">Admin</a></li>
  69. <li><a href="About Site.php">About Us</a>
  70. <ul>
  71. <li><a href="About Site.php">About Site</a></li>
  72. <li><a href="Contact Us.php">Contact Us</a></li>
  73. </ul>
  74. </li>
  75. </ul>
  76. </nav>
  77. </div>
  78. <div id="Content">
  79. <div id="PageHeading">
  80. <h1>&nbsp;</h1>
  81. <h1>&nbsp;</h1>
  82. <h1>&nbsp;</h1>
  83. <h1>Welcome, <?php echo $row_Voters_Account_Form['Fname']; ?> <?php echo $row_Voters_Account_Form['Mname']; ?> <?php echo $row_Voters_Account_Form['Lname']; ?>!</h1>
  84. </div>
  85. <div id="ContentLeft">
  86. <h2>Your Message Here</h2></b>
  87. <h6>This site is to improve the style of voting in West End University College and other school at large, if it is implementted. </h6>
  88. <h6>&nbsp;</h6>
  89. <h6>Note: Please be advice that once you have placed your vote, you won't be allowed to login again. so there for you can only view the result from of the election from the Hoe page.</h6>
  90. </div>
  91. <div id="ContentRight">
  92. <form id="form1" name="form1" method="post">
  93. </form>
  94. <table width="400" border="0" align="center">
  95. <tbody>
  96. <tr>
  97. <td>
  98. <div id="slider" class="nivoSlider">
  99. <img src="slider/IMG-20151117-WA00011234.jpg" name="imageField" data-thumb= "slider/IMG-20151117-WA00011234.jpg" alt="" title="These are the candidates for the election"/>
  100. <img src="slider/FB_IMG_1484460719710123.jpg" data-thumb="slider/FB_IMG_1484460719710123.jpg" alt ="" title="These are the candidates for the election" />
  101. <img src="slider/FB_IMG_14845217848411234567.jpg" data-thumb= "slider/FB_IMG_14845217848411234567.jpg" alt="" title="These are the candidates for the election"/>
  102. <img src="slider/IMAG002012345678.jpg" data-thumb= "slider/IMAG002012345678.jpg" alt="" title="These are the candidates for the election"/>
  103. <img src="slider/FB_IMG_1484461298331123456.jpg" data-thumb= "slider/FB_IMG_1484461298331123456.jpg" alt="" data-transition="slideInRight" title="These are the candidates for the election"/>
  104. <img src="slider/FB_IMG_148446110711012345.jpg" data-thumb="slider/FB_IMG_148446110711012345.jpg" alt="" title="#htmlcaption" />
  105. </div>
  106.  
  107. <script type="text/javascript">
  108. $(window).load(function() {
  109. $('#slider').nivoSlider({
  110. effect:'random',
  111. slices: 15,
  112. boxCols: 8,
  113. boxRows: 4,
  114. animSpeed: 500,
  115. pauseTime: 3000,
  116. startSlide: 0,
  117. directionNav:true,
  118. controlNav:true,
  119. controlNavThumbs:false,
  120. pauseOnHover:true,
  121. manualAdvance:false,
  122. prevText:'Prev',
  123. nextText:'Next',
  124. randomStart:false,
  125. beforeChange:function(){},
  126. afterChange:function(){},
  127. slideshowEnd:function(){},
  128. lastSlide:function(){},
  129. afterLoad:function(){}
  130. });
  131. });
  132. </script>
  133. </td>
  134. </tr>
  135. <table width="0" border="0" align="center">
  136. <tr>
  137. <td>
  138. <input type="button" name="button" id="button" value="Click here to cast your vote" onClick="window.location.href='Voting.php' ">
  139. </td>
  140. </tr>
  141. </table>
  142. <tr>
  143. <td>&nbsp;</td>
  144. </tr>
  145. <tr>
  146. <td>&nbsp;</td>
  147. </tr>
  148. <tr>
  149. <td>&nbsp;</td>
  150. </tr>
  151. <tr>
  152. <td>&nbsp;</td>
  153. </tr>
  154. <tr>
  155. <td>&nbsp;</td>
  156. </tr>
  157. </tbody>
  158. </table>
  159. </div>
  160. </div>
  161. <div id="Footer"></div>
  162. </div>
  163. <p>&nbsp;</p>
  164. </body>
  165. </html>
  166. <?php
  167. mysql_free_result($Voters_Account_Form);
  168. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement