0
My code is like this:
<!-- caixa de seleção de técnicos -->
</style>
<body>
<p>Técnico</p>
<form method="post" action="salvar.php">
<b><select name="nome">
<option value="vazio"></option>
<option value="Andre">Andre Silveira Da Silva - N5692999</option>
<option value="Deivis">Deivis Ingracio Maciel - N5744364</option>
<option value="Josoe">Josoe Alves Rodrigues - N5688572</option>
<option value="Nardi">Leandro Nunes Nardi - N5631153</option>
<option value="Lucas">Lucas Vieira Noble - N4011863</option>
<option value="Cabreira">Marcel Rodrigues Cabreira - N5722079</option>
<option value="Matheus">Matheus Rosa Da Silva - N5781269</option>
<option value="Paulo">Paulo Guilherme Da Luz Santos - N5766893</option>
<option value="Willian">Willian Moraes Dos Santos - N5720370</option>
</select>
<p><label>Áreas: <br>
<!-- caixas de "radio button" das áreas -->
<form method="post" action="salvar.php">
<input name="marcar[]" type="checkbox"id="marcar[]" value="Grande_Poa">Conurbadas<br><br>
<tr><input name="marcar[]" type="checkbox" id="marcar[]" value="area1">Área 1</tr>
<input name="marcar[]" type="checkbox"id="marcar[]" value="area2">Área 2<br>
<tr><input name="marcar[]" type="checkbox"id="marcar[]" value="area3">Área 3</tr>
<input name="marcar[]" type="checkbox"id="marcar[]" value="area4">Área 4<br>
<tr><input name="marcar[]" type="checkbox"id="marcar[]" value="area5">Área 5</tr>
<input name="marcar[]" type="checkbox"id="marcar[]" value="area6">Área 6<br>
<tr><input name="marcar[]" type="checkbox"id="marcar[]" value="area7">Área 7</tr>
<input name="marcar[]" type="checkbox"id="marcar[]" value="area8">Área 8<br>
<tr><input name="marcar[]" type="checkbox"id="marcar[]" value="area9">Área 9</tr>
<input name="marcar[]" type="checkbox"id="marcar[]" value="area10">Área 10<br><br>
<tr><input name="marcar[]" type="checkbox"id="marcar[]" value="LOGs">LOG's</tr>
</form>
</label></p>
<!-- Botões -->
<div align="center">
<input type="submit"name="salvar" value="Salvar" />
<input type="button"name="listar" value="Visualizar" />
<input type="button"name="excluir" value="Excluir" />
</form>
Data to save got like this:
<?php
@ini_set('display_errors', '1');
error_reporting(E_ALL);
$nome = $_POST["nome"];
$areas = $_POST["marcar"];
foreach($_POST['marcar'] as $marcar) {
echo "Valor Recebido: ".$marcar;
}
mysql_connect("localhost", "root", "");
mysql_select_db("tcc");
mysql_query("INSERT INTO tratamentos ( id_tratamentos, nome , areas )
VALUES ( NULL , '$nome','$areas')");
mysql_close();
echo "Salvo com sucesso<tr><br />";
?>
<a href="index.php">Voltar</a>
Welcome to stackoveflow in English, explain better what you want. What’s the problem you’re having? A brief summary of what is happening would be nice.
– Jorge B.
i need the user to be able to select several areas and a technician to register. e ne enrolei in the array
– Matheus rosa