I'm creating a list of contacts in php, and when I'm uploaded all the form data for it to display for me, it displayed: 1, not my data I entered.
<?php session_start(); ?>
<!DOCTYPE html>
<html>
<head>
<title>Adicionar contatos</title>
</head>
<body>
<h1> Adicionar Contatos </h1>
<form>
<fieldset>
<legend>Adicionar contato</legend>
<label>
Contato:
<input type="text" name="numero">
Nome:
<input type="text" name="nome">
Email:
<input type="text" name="email">
</label>
<input type="submit" name="Cadastrar">
</fieldset>
</form>
<?php
$lista_contatos = array();
if(isset($_GET['numero']) && isset($_GET['nome']) && isset($_GET['email'])){
$_SESSION['lista_contatos'][] = $_GET[numero] && $_GET[nome] && $_GET[email];
}
if(isset($_SESSION['lista_contatos'])){
$lista_contatos = $_SESSION['lista_contatos'];
}
?>
<table>
<tr>
<th>Contatos</th>
</tr>
<?php foreach ($lista_contatos as $contatos) : ?>
<tr>
<td><?php echo $contatos; ?></td>
</tr>
<?php endforeach; ?>
</table>
</body>
</html>