Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. <?php
  2. include ("database.php");
  3. include ("cookieusername.php");
  4.  
  5. ?>
  6. <title>
  7. MySite - Profile - <?php echo $username ?>
  8. </title>
  9.  
  10. <style type="text/css">
  11. <!--
  12. A:link { COLOR: black; TEXT-DECORATION: none; font-weight: normal }
  13. A:visited { COLOR: black; TEXT-DECORATION: none; font-weight: normal }
  14. A:active { COLOR: green; TEXT-DECORATION: none }
  15. A:hover { COLOR: blue; TEXT-DECORATION: none; font-weight: none }
  16. -->
  17. </style>
  18.  
  19. <?php
  20. include ("database.php");
  21. // include ("echousername.php");
  22. include ("background.php");
  23. // include ("cookieusername.php");
  24. // if ($_COOKIE['ID_my_site'])
  25.  
  26. ?>
  27.  
  28. <br><p>
  29. <div id="mydiv">
  30. <style type="text/css">
  31. DIV { display: none; }
  32. </style>
  33.  
  34. <Center><b>Additional Details</b>
  35.  
  36. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
  37. <table border="0"><center>
  38.  
  39. <Br><p><center><b>Bithrdate
  40. Day:<name="day" />
  41. <select>
  42. <?php
  43. for($iii = 1; $iii <= 31; $iii++)
  44. {
  45. echo "<option>$iii</option>";
  46. }
  47. ?>
  48. </select>
  49.  
  50. Month:<name="month" />
  51. <select>
  52. <option>January</option>
  53. <option>Febuary</option
  54. ><option>March</option
  55. ><option>April</option
  56. ><option>May</option
  57. ><option>June</option
  58. ><option>July</option
  59. ><option>August</option
  60. ><option>September</option
  61. ><option>October</option
  62. ><option>November</option
  63. ><option>December</option
  64. ></select>
  65.  
  66.  
  67. Year:<name="year" />
  68. <select>
  69. <?php
  70. for($iii = 1900; $iii <= 2010; $iii++)
  71. {
  72. echo "<option>$iii</option>";
  73. }
  74. ?>
  75. </select><br />
  76.  
  77.  
  78. Username: <input type="text" name="username" /><br />
  79. First name: <input type="text" name="firstname" /><br />
  80. Last name: <input type="text" name="lastname" /><br />
  81. <b>Location</b><br />
  82. Location: (eg, country, state, city)<input type="text" name="location" /><br />
  83. <b>Gender</b><br />
  84. <input type="radio" name="gender" value="male" />Male<br />
  85. <input type="radio" name="gender" value="female" />Female<br />
  86. <input type="submit" name="submit" value="submit" />
  87. </form></table>
  88. </div>
  89.  
  90.  
  91. <?php
  92.  
  93. //Checks if there is a login cookie
  94. if(isset($_COOKIE['ID_my_site']))
  95. {
  96. $username = mysql_real_escape_string( $_COOKIE['ID_my_site'] );
  97. $pass = mysql_real_escape_string( $_COOKIE['Key_my_site'] );
  98.  
  99. $check = mysql_query("SELECT * FROM users WHERE username = '$username' AND password = '$pass'")or die(mysql_error());
  100.  
  101. while($info = mysql_fetch_array( $check ))
  102. {
  103. if ($username == $info['username'])
  104. echo "$username";
  105. }
  106. }
  107.  
  108. if (isset($_POST['submit'])) {
  109. $firstname = ($_POST['firstname']);
  110. $lastname = ($_POST['lastname']);
  111. $day = ($_POST['day']);
  112. $month = ($_POST['month']);
  113. $year = ($_POST['year']);
  114. $location = ($_POST['location']);
  115. include ("cookieusername.php");
  116.  
  117. $check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
  118. while($info = mysql_fetch_array( $check ))
  119. $filename = "/home/giacjrdi/public_html/mysite/profiles/profileinfo/$username.info.php" or exit("Unable to open file!");
  120. $handle = fopen($filename, 'w')or die;
  121. $content = "<b>Firstname: </b>$firstname <br> <b> Lastname: </b> $lastname <p> <b> Birthday: </b>$day $month $year <br> <b> Location: </b> $location";
  122. fwrite($handle, $content)or die;
  123. fclose($handle);
  124. }
  125. $check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
  126. while($info = mysql_fetch_array( $check ))
  127.  
  128. include ("$username.info.php")or die;
  129. ?>
  130.  
  131. <br>
  132.  
  133. <center>
  134. <a href="javascript:;" onmousedown="if(document.getElementById('mydiv').style.display == 'none')
  135. { document.getElementById('mydiv').style.display = 'block'; }
  136. else{ document.getElementById('mydiv').style.display = 'none'; }">Edit Information.</a>
  137. </center>
  138.  
  139. <br>
  140.  
  141.  
  142.  
  143. <br>
  144.  
  145.  
  146.  
  147. <br>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement