-
Notifications
You must be signed in to change notification settings - Fork 0
/
ler_cadastro.php
54 lines (49 loc) · 1.76 KB
/
ler_cadastro.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
extract($_REQUEST);
session_start();
if (isset($_SESSION["login"]) == false) {
header("Location: index.php");
return;
}
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>Cadastro</title>
<link rel="stylesheet" type="text/css" href="tema.css">
</head>
<body>
<nav id="navigation" class="clearfix">
<ul>
<li><a href="index.php" >Home </a></li>
<li><a href="listar.php" >Listar </a></li>
<li><a href="busca.php" >Buscar </a></li>
<li><a href="carrinho.php">Carrinho</a></li>
</ul>
</nav>
<div align="right">
<a href="ler_cadastro.php"><?= $_SESSION["login"]. ","?></a>
<a href="logout.php"> sair</a>
</div>
<?php
require 'conexao.php';
$id_cliente = isset($_SESSION["id_cliente"]) ? $_SESSION["id_cliente"] : "";
$sql_preenche_formulario = "SELECT *
FROM clientes
WHERE id_cliente = {$id_cliente}";
$cliente = mysqli_fetch_assoc(mysqli_query($conexao,
$sql_preenche_formulario));
?>
<form accept-charset="utf-8" method=POST action="alterar_cadastro.php">
<b>Nome: <br><input type="text" name="nome" value="<?= $cliente["nome"] ?>"><p>
E-mail: <br><input type="text" name="email" value="<?= $cliente["email"] ?>"><p>
Login: <br><input type="text" name="login" value="<?= $cliente["login"] ?>"><p>
Senha:</b><br><input type="password" name="senha" value="" ><p>
<input type="submit" value="Alterar">
</form>
<?php
mysqli_close($conexao);
?>
</body>
</html>