Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.00 KB | None | 0 0
  1. <?php session_start();
  2. include('credentials.php');
  3.  
  4. ?>
  5.  
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9.   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10.   <link rel="stylesheet" type="text/css" href="css.css"/>
  11. </head>
  12.  
  13. <body>
  14.  
  15. <div id="container">
  16.  
  17.   <div id="header">
  18. <p class="top"> <strong> Dark Side Buisness Controller </strong> </p>
  19.   </div>
  20.     <div id="menu">
  21.         <ul>
  22.             <li><a href="index.php"> Home Page </a></li>
  23.             <li><a href="about.php"> About US </a></li>
  24.             <li><a href="register.php"> Register </a></li>
  25.             <li><a href="login.php"> Login </a><li>
  26.            
  27.                         <?php if ( isset($_SESSION['name'])) { ?>
  28.                         <li><a href="control.php"> Control Panel</a><li>
  29.             <li><a href="upload.php"> Upload </a><li>
  30.             <li><a href="logout.php"> Logout</a><li>
  31.                        
  32.                         <?php
  33.             }
  34.             ?>
  35.  
  36.            
  37. </ul>
  38.  
  39.     </div>
  40.  
  41. <div id="main">
  42. <?php
  43. $username=$_SESSION['name'];
  44. $link=@mysqli_connect("localhost",$dbuser,$dbpass,$dbname);
  45. if (mysqli_connect_errno()){
  46. echo "Error at DB connection";
  47. echo mysqli_connect_error();
  48. die(mysqli_error());
  49. }
  50. $query="SELECT afm from users where username='$username'";
  51. $result=mysqli_query($link,$query);
  52. $row=mysqli_fetch_assoc($result);
  53.  
  54. if ($row["afm"] == NULL) {
  55. ?>
  56. <form method="POST" name="moreinfof" id="moreinfof" action="insertmore.php">
  57. <table width="100%" cellpadding="3" cellspacing="2">
  58. <p><strong> Insert Your Personal infos</strong></p>
  59. <tr>
  60.     <td class="right"> <strong> AFM </strong> </td>
  61.     <td>
  62.     <input type="text" name="afm" id="afm"/>
  63.     </td>
  64. </tr>
  65. <tr>
  66.     <td class="right"> <strong> Year of Birth</strong> </td>
  67.     <td>
  68.     <select name="yearofb" id="yearofb">
  69.         <option value=-1 style="color:red" selected="selected"> --Choose your Birthday Year--</option>
  70.         <option value=1> 1993 </option>
  71.         <option value=2> 1992 </option>
  72.         <option value=3> 1991 </option>
  73.         <option value=4> 1990 </option>
  74.         <option value=5> 1989 </option>
  75.         <option value=6> 1988 </option>
  76.         <option value=7> 1987 </option>
  77.         <option value=8> 1986 </option>
  78.         <option value=9> 1985 </option>
  79.         <option value=10> 1984 </option>
  80.         <option value=11> 1983 </option>
  81.         <option value=12> 1982 </option>
  82.         <option value=13> 1981 </option>
  83.         <option value=14> 1980 </option>
  84.         <option value=15> 1979 </option>
  85. </select>
  86. </td>
  87. </tr>
  88. <tr>
  89.     <td class="right"> <strong> Sex </strong> </td>
  90.     <td>
  91. <input type="radio" id="male" name="male" value="1"/>
  92. <label for="male"> Male</label>
  93. &nbsp;&nbsp;&nbsp;  
  94. <input type="radio" id="fmale" name="fmale" value="0"/>
  95. <label for="fmale"> Female</label>
  96. </td>
  97. </tr>
  98. <tr>
  99. <td class="right">
  100. <input  name="reset" id="reset" type="reset" value="Reset"/>
  101. <input  name="submit" id="submit" type="submit" value="Submit"/>
  102. </td>
  103. </tr>
  104. </table>
  105. </form>
  106. <?php
  107. }
  108. else {
  109. $afm=$row["afm"];
  110. $year=$row["year"];
  111. $gender=$row["gender"];
  112.  
  113. ?>
  114. <form method="POST" name="moreinfof" id="moreinfof" action="insertmore.php">
  115. <table width="100%" cellpadding="3" cellspacing="2">
  116. <p><strong>Update your Infos</strong></p>
  117. <tr>
  118.     <td class="right"> <strong> AFM </strong> </td>
  119.     <td>
  120.     <input type="text" name="afm" id="afm" value="<?php echo $afm?>/>
  121.     </td>
  122. </tr>
  123.  
  124. <tr>
  125.     <td class="right"> <strong> YEAR </strong> </td>
  126.     <td>
  127.     <input type="text" name="year" id="year" value="<?php echo $year?> />
  128.     </td>
  129. </tr>
  130. <tr>
  131.     <td class="right"> <strong> Gender </strong> </td>
  132.        <td>
  133.     <input type="text" name="gender" id="gender" value="<?php echo $gender?> />
  134.     </td>
  135. </tr>
  136.        <tr>
  137. <td class="right">
  138. <input  name="reset" id="reset" type="reset" value="Reset"/>
  139. <input  name="submit" id="submit" type="submit" value="Submit"/>
  140. </td>
  141. </tr>
  142. </table>
  143. </form>
  144. <?php
  145. }
  146. ?>
  147. <?php
  148. mysqli_close($link);
  149. ?>
  150. </div>
  151.  
  152.   <div id="footer">
  153.     <p>&copy; 2012 - ΤΕΙ Λάρισας</p>
  154.   </div>
  155.  
  156. </div>
  157.  
  158. </body>
  159. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement