Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $data=array(NULL/*DATA*/
- /*DATA*/);
- if(isset($_POST['submit']))
- {
- $site=strtr($_POST['site'],array("'"=>"\\'"));
- $user=strtr($_POST['user'],array("'"=>"\\'"));
- $pass=strtr($_POST['pass'],array("'"=>"\\'"));
- $ts="";
- $f=fopen(basename($_SERVER['REQUEST_URI']),'c+');
- while(!feof($f))
- $ts.=fread($f,8192);
- $ta=explode('/*DATA*/',$ts);
- $ta[1].=",array('$site','$user','$pass')\n";
- $ts=implode('/*DATA*/',$ta);
- fseek($f,0);
- fwrite($f,$ts);
- fclose($f);
- $data[]=array($site,$user,$pass);
- }
- ?>
- <html>
- <head>
- <title>passwords</title>
- <style type="text/css">
- body { background:#aaa; font: normal 11px/1.5 "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Verdana, sans-serif }
- table { width:100%; background:#bbb; margin:20px auto; border:1px solid #669}
- input { width:90% }
- .data0 { border-top: 1px solid #aac; padding:2px 5px; }
- .data1 { border-top: 1px solid #aac; padding:2px 5px; background:#cccccc }
- .end { border-top: 1px solid #aac; padding: 2px 5px; background:#a8a8a8 }
- th { padding: 2px 5px;background:#b8b8b8}
- .button { width:100px; float:right}
- div { width: 80%;margin-left:auto;margin-right:auto }
- </style>
- </head>
- <body>
- <div>
- <form action="" method="POST">
- <table>
- <tr><th style="width:50%">Site</th><th>Username</th><th>Password</th></tr>
- <?
- $count=0;
- foreach($data as $td)
- {
- if($td!=NULL)
- echo " <tr class='data".($count%2)."'><td>$td[0]</td><td>$td[1]</td><td>$td[2]</td>
- ";
- $count++;
- }
- ?><tr><td><input name="site"/></td><td><input name="user"></td><td><input name="pass"></td></tr>
- </table>
- <input class="button" type="submit" name="submit" value="Add"/>
- </form>
- </div>
- </body>
- </html>
- <?
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement