-2
good night! I have a page for editing the user data that is logged in at that time in the account, however, I am receiving an error message from the page:
Here is the php code of the page:
<?php
include("../banco/conexao.php");
if(isset($_GET['id'])) {
$id = $_GET['id'];
$query = "SELECT * FROM usuario WHERE id=$id";
$result = mysqli_query($conexao,$query);
if(mysqli_num_rows($result) == 1) {
$row = mysqli_fetch_array($result);
$nomeUsuario = $row['nomeUsuario'];
$cpfUsuario = $row['cpfUsuario'];
$usuario = $row['usuario'];
$emailUsuario = $row['emailUsuario'];
$senhaUsuario = $row['senhaUsuario'];
}
if(isset($_POST['salvar'])) {
$id = $_GET['id'];
$nomeUsuario = $_POST['nomeUsuario'];
$cpfUsuario = $_POST['cpfUsuario'];
$usuario = $_POST['usuario'];
$emailUsuario = $_POST['emailUsuario'];
$senhaUsuario = $_POST['senhaUsuario'];
$query = "UPDATE usuario SET nomeUsuario = '$nomeUsuario', cpfUsuario = '$cpfUsuario', usuario = '$usuario',
emailUsuario = '$emailUsuario', senhaUsuario = '$senhaUsuario' WHERE id = $id";
mysqli_query($conexao,$query);
echo "<script type='text/javascript'>window.alert('Usuário Editado com Sucesso!');</script>";
echo '<meta HTTP-EQUIV="Refresh" CONTENT="1; URL=pagUsuario.php">';
exit;
header("Location: pagUsuario.php");
}
}
?>
And line 61, where he’s saying it contains the error:
<form action="editarPerfilUsuario.php?id=<?php echo $_GET['id']; ?>" method="">
I’m having a hard time because it’s a college project and I’m doing it together with other colleagues, but even they’re having trouble understanding it themselves, someone could give a help?