I'm using the MDL framework (google) to make a registration system, and in the part of changing the information in the database, in passing the values through the url, only some are passed and some are not. In addition, the first and last names do not appear in the form, although the url has received both. Here is the code: page that shows the data (clients.php):
$seleciona="select * from cadastro_clientes";
$sql=mysqli_query($con,$seleciona);
while ($reg=mysqli_fetch_assoc($sql)) {
echo "
<tr>
<td class=mdl-data-table__cell--non-numeric>$reg[nome]</td>
<td class=mdl-data-table__cell--non-numeric>$reg[endereco]</td>
<td class=mdl-data-table__cell--non-numeric>$reg[numero]</td>
<td class=mdl-data-table__cell--non-numeric>$reg[dada_comemorada]
</td>
<td class=mdl-data-table__cell--non-numeric>
<a href=form_edit.php?ru="
.urlencode($reg['nome']).
"&en=".urldecode($reg['endereco']).
"&nu=".urldecode($reg['numero']).
"&da=".urldecode($reg['dada_comemorada']).
">Editar</a></td>
</tr>";
}
?>
page that should show data to change (form_edit.php):
<?php
include"conecta.inc";
$recebenome=$_GET['ru'];
$recebeendereco=$_GET['en'];
$numero=$_GET['nu'];
$data=$_GET['da'];
?>
<div class="page-content">
<form action="cadastrar.php" method="post" name="cadastro">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="sample3" name="nome" value=<?php echo $recebenome;?>>
<label class="mdl-textfield__label" for="sample3">NOME</label>
</div><br>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="sample3" name="endereco" value=<?php echo $recebeendereco;?>>
<label class="mdl-textfield__label" for="sample3">ENDEREÇO</label>
</div><br>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="sample3" name="numero" value=<?php echo $numero;?>>
<label class="mdl-textfield__label" for="sample3">NUMERO</label>
</div><br>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="sample3" name="data" value=<?php echo $data;?>>
<label class="mdl-textfield__label" for="sample3">DATA COMEMORADA</label>
</div><br>
<input type="submit" value="SALVAR" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">
</form>
</div>
In the url the first and last name passes, but does not appear in the form, and the number and date give the error "Notice: Undefined index: nu in C: \ xampp \ htdocs \ Bjorn \ form_edit.php on line 5", but if I register some client without space, all appear normally. I do not know why, since I used urlencode: /
note, when I click on the client that is without writing without separating the words by space:
NowwhenIclickontheregisteredclientwithspacesseparatingthefirstandlastnames,andtheaddress(notethattheurlreceivesthefirstandlastnamebutnotthefulladdress: