Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <?php
- $conexao = mysql_connect('localhost', 'root', '3630207')
- or die('Erro ao conectar com o bando de dados!');
- $db = mysql_select_db('informacoes')
- or die('Erro ao selecionar o banco de dados!');
- ?>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Exibir dados</title>
- </head>
- <body>
- <h1>
- <?php if(isset($_POST['editar']))
- {
- $usuario = $_POST['usuario'];
- $senha = $_POST['senha'];
- $score = $_POST['score'];
- $dinheiro = $_POST['dinheiro'];
- $avisos = $_POST['avisos'];
- $nivel = $_POST['nivel'];
- $vip = $_POST['vip'];
- $skin = $_POST['skin'];
- $admin = $_POST['admin'];
- $atualiza = mysql_query("UPDATE informacoes SET usuario = '$usuario', senha = '$senha', score = '$score', dinheiro = '$dinheiro', avisos = '$avisos', nivel = '$nivel', vip = '$vip', skin = '$skin', admin = '$admin' WHERE usuario = '$usuario'");
- if($atualiza == '')
- {
- echo 'Erro ao atualizar usuário.';
- }else
- {
- echo 'Dados atualizados com sucesso.';
- }
- }?>
- <?php
- $usuario = $_GET['usuario'];
- $seleciona = mysql_query("SELECT * FROM informacoes WHERE usuario = '$usuario'");
- if($seleciona == ''){
- echo 'Erro ao selecionar usuario!';
- }else{
- while($res_usuario = mysql_fetch_array($seleciona))
- {
- $usuario = $res_usuario['usuario'];
- $senha = $res_usuario['senha'];
- $score = $res_usuario['score'];
- $dinheiro = $res_usuario['dinheiro'];
- $avisos = $res_usuario['avisos'];
- $nivel = $res_usuario['nivel'];
- $vip = $res_usuario['vip'];
- $skin = $res_usuario['skin'];
- $admin = $res_usuario['admin'];
- ?>EDIÇÃO DE USUÁRIOS
- </h1>
- <form name="editar" action="" enctype="multipart/form-data" method="post">
- <input name="usuario" type="text" disabled="disabled" value="<?php echo $usuario; ?>" />
- <input type="text" name="senha" value="<?php echo $senha; ?>" />
- <input type="text" name="score" value="<?php echo $score; ?>" />
- <input type="text" name="dinheiro" value="<?php echo $dinheiro; ?>" />
- <input type="text" name="avisos" value="<?php echo $avisos; ?>" />
- <input type="text" name="nivel" value="<?php echo $nivel; ?>" />
- <input type="text" name="vip" value="<?php echo $vip; ?>" />
- <input type="text" name="skin" value="<?php echo $skin; ?>" />
- <input type="text" name="admin" value="<?php echo $admin; ?>" />
- <input type="hidden" name="usuario" value="<?php echo $usuario; ?>" />
- <input type="submit" name="editar" value="editar" />
- </form>
- <form name="voltar" action="index.php">
- <input type="submit" name="Voltar" value="Voltar" />
- </form>
- <?php
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement