Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'res/development/config.php';
- if(isset($_POST['log_create'])){
- $qry = $GLOBALS['db']->prepare("INSERT INTO log(log_time, log_info) VALUES(:log_time, :log_info)");
- $qry->execute(array(":log_time" => date("d/m/Y H:i:s", time()), ":log_info" => $_POST['log_info']));
- }
- function getLogs(){
- $qry = $GLOBALS['db']->prepare("SELECT * FROM log ORDER BY log_id DESC");
- $qry->execute();
- while($logData = $qry->fetch(PDO::FETCH_ASSOC)){
- $ret = "<div class='box'><span class='time'><strong>{$logData['log_time']}</strong></span><div class='content'>
- -{$logData['log_info']}
- </div></div>";
- print($ret);
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>TinyPrivate - LOG</title>
- </head>
- <body>
- <style type="text/css">
- body{
- background-color: #eee;
- font-family: Verdana;
- }
- .box{
- display: box;
- border:1px solid;
- border-radius: 5px;
- background-color: #eee;
- margin-top:3px;
- text-align: left;
- }
- .box .content{
- text-align: center;
- margin-bottom: 20px;
- }
- .time{
- margin-left:5px;
- font:14px/10px sans-serif;
- }
- </style>
- <?php
- if($_SERVER['REMOTE_ADDR'] == "109.105.39.50"){
- ?>
- <form action="<?PHP $PHP_SELF; ?>" method="POST">
- <div class="box" style="border-radius: 0px;height: 100px;">
- <div class="content">
- <textarea name="log_info" placeholder="..."></textarea><br/>
- <input type="submit" name="log_create" value="Create log">
- </div>
- </div>
- </form>
- <?php
- }
- ?>
- <center>
- <h1>TinyPrivate-LOGS</h1>
- <br/>
- <?php echo getLogs(); ?>
- <br/>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement