Jump to content

Salvatore

Members
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

0 Comum

About Salvatore

  1. Olá estou alguém poderia me ajudar a criar um botão no painel onde eu apago um conteúdo da .txt Código Abaixo Painel <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="imagem/png" href="img/icon.png" /> <script language=javascript> senha = 'plsfodas'; senhadig = prompt("Digite a senha","") if (senha != senhadig){ alert('Acesso negado!'); top.location.href='index.php'; } </script> <title>Painel De Controle</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> <script> $(function() { var wbbOpt = { buttons: "bold,italic,underline,|,img,link,|,code,quote" } $("#link").wysibb(wbbOpt); }) </script> </head> <body> <div class="container"> <div class="row"> <header class="col-sm-12"> <h1>Painel de Controle</h1> <p><a href="index.php" class="btn btn-info"><i class="fa fa-arrow-left"></i> Plugins</a></p><br/> </header> <div id="content-form" class="col-sm-12"> <?php if(isset($_POST['plugin']) && isset($_POST['valor']) && isset($_POST['link']) && isset($_POST['version'])) { $plugin = $_POST['plugin']; $valor = $_POST['valor']; $link = $_POST['link']; $version = $_POST['version']; $news = unserialize(file_get_contents('news.txt')); $news[] = array('plugin' => $plugin, 'version' => $version, 'valor' => $valor, 'link' => $link); file_put_contents('news.txt', serialize($news)); echo '<div class="alert alert-dismissible alert-success"><h4><i class="fa fa-check"></i> Concluido</h4><p>Informações adicionadas'; echo '<br/>'; echo '<a href="index.php" class="alert-link">Visualizar</a></p></div>'; } else { ?> <form action="" class="form-horizontal" method="post"> <div class="form-group"> <label class="col-sm-2 control-label" for="plugin">Nome do Plugin</label> <div class="col-sm-10"> <input class="form-control" type="text" name="plugin" id="plugin" placeholder="Plugin" autofocus required> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label" for="version">Versão</label> <div class="col-sm-10"> <input class="form-control" type="text" name="version" id="version" placeholder="Version" autofocus required> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label" for="valor">Valor</label> <div class="col-sm-10"> <input class="form-control" type="text" name="valor" id="valor" placeholder="valor" autofocus required> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label" for="link">Link</label> <div class="col-sm-10"> <input class="form-control" type="text" name="link" id="link" placeholder="Link" autofocus required> </div> </div> <button class="btn btn-primary pull-right" type="submit"><i class="fa fa-plus"></i>Adicionar</button> </form> </div> <footer class="col-sm-12"> <p><i class="fa fa-copyright"></i> <a</p> </footer> </div> </div> </body> </html> o meu arquivo txt fica assim, ai quando eu colocasse o id no input e clica no botão apaga apagasse a:1:{i:0;a:4:{s:6:"plugin";s:4:"1212";s:7:"version";s:3:"121";s:5:"valor";s:1:"1";s:4:"link";s:3:"212";}}
×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.