Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. <?
  2. $data=array(NULL/*DATA*/
  3. /*DATA*/);
  4.  
  5. if(isset($_POST['submit']))
  6. {
  7. $site=strtr($_POST['site'],array("'"=>"\\'"));
  8. $user=strtr($_POST['user'],array("'"=>"\\'"));
  9. $pass=strtr($_POST['pass'],array("'"=>"\\'"));
  10.  
  11.  
  12. $ts="";
  13. $f=fopen(basename($_SERVER['REQUEST_URI']),'c+');
  14. while(!feof($f))
  15. $ts.=fread($f,8192);
  16. $ta=explode('/*DATA*/',$ts);
  17. $ta[1].=",array('$site','$user','$pass')\n";
  18. $ts=implode('/*DATA*/',$ta);
  19. fseek($f,0);
  20. fwrite($f,$ts);
  21. fclose($f);
  22. $data[]=array($site,$user,$pass);
  23. }
  24. ?>
  25. <html>
  26. <head>
  27. <title>passwords</title>
  28. <style type="text/css">
  29. body { background:#aaa; font: normal 11px/1.5 "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Verdana, sans-serif }
  30. table { width:100%; background:#bbb; margin:20px auto; border:1px solid #669}
  31. input { width:90% }
  32. .data0 { border-top: 1px solid #aac; padding:2px 5px; }
  33. .data1 { border-top: 1px solid #aac; padding:2px 5px; background:#cccccc }
  34. .end { border-top: 1px solid #aac; padding: 2px 5px; background:#a8a8a8 }
  35. th { padding: 2px 5px;background:#b8b8b8}
  36. .button { width:100px; float:right}
  37. div { width: 80%;margin-left:auto;margin-right:auto }
  38. </style>
  39. </head>
  40. <body>
  41. <div>
  42. <form action="" method="POST">
  43. <table>
  44. <tr><th style="width:50%">Site</th><th>Username</th><th>Password</th></tr>
  45. <?
  46. $count=0;
  47. foreach($data as $td)
  48. {
  49. if($td!=NULL)
  50. echo " <tr class='data".($count%2)."'><td>$td[0]</td><td>$td[1]</td><td>$td[2]</td>
  51. ";
  52. $count++;
  53. }
  54. ?><tr><td><input name="site"/></td><td><input name="user"></td><td><input name="pass"></td></tr>
  55. </table>
  56. <input class="button" type="submit" name="submit" value="Add"/>
  57. </form>
  58. </div>
  59. </body>
  60. </html>
  61. <?
  62. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement