I'm learning PHP and am experiencing some problems with special characters, see:
Thefunnythingisthatinthetableitemsitdisplaysaccentandspecialcharacters.Andyes,I'vetriedusingthe<metacharset="UTF-8"/>
and also
<?php ini_set('default_charset','UTF-8');?>
to <meta http-equiv="content-Type" content="text/html; charset=iso-8859-1" />
e
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Still the problem persists.
This is my main form:
<html>
<head>
<?phpini_set('default_charset','UTF-8');?>
<title>Gerenciação de Tarefas</title>
</head>
<body>
<h2>Gerenciador de Tarefas</h2>
<?php include('formulario.php'); ?>
<?php if ($exibir_tabela) : ?>
<?php include('tabela.php'); ?>
<?php endif; ?>
</body>
</html>
This is the registration form:
<meta charset="UTF-8"/>
<form>
<fieldset>
<legend><b>Nova tarefa</b></legend>
<?php
$_id = $tarefa["id"];
$_nome = $tarefa["nome"];
$_descricao = $tarefa["descricao"];
$_prioridade = $tarefa["prioridade"];
$_prazo = $tarefa["prazo"];
$_concluida = $tarefa["concluida"];
?>
<input type = "hidden" name = "id"
value = "<?php echo $_id; ?>" />
<label>
Tarefa
<br>
<input type = "text" name = "nome"
value = "<?php echo $_nome; ?>"/>
</label>
<br><br>
<label>
Descrição(Opcional)
<br>
<textarea name = "descricao"><?php echo $_descricao; ?></textarea>
</label>
<br><br>
<label>
Prazo(Opcional)
<br>
<input type = "text" name = "prazo"
value = "<?php echo traduz_data_para_view($_prazo); ?>"/>
</label>
<br><br>
<fieldset>
<legend>Prioridade</legend>
<label>
<input type = "radio" name = "prioridade" value = "1"<?php echo ($_prioridade == 1)?'checked':''; ?>/>
Baixa
<input type = "radio" name = "prioridade" value = "2" <?php echo ($_prioridade == 2)?'checked':''; ?>/>
Média
<input type = "radio" name = "prioridade" value = "3"<?php echo ($_prioridade == 3)?'checked':''; ?>/>
Alta
</label>
</fieldset>
<br><br>
<label>
<input type = "checkbox" name = "concluida" value = "1" <?php echo ($_concluida == 1)?'checked':''; ?>/>
Tarefa Concluída
</label>
<br><br>
<input type = "submit" value = "<?php echo ($tarefa["id"] > 0) ? "Atualizar" : "Cadastrar"; ?>"/>
</fieldset>
</form>
This is the table form:
<meta charset="UTF-8"/>
<form>
<fieldset>
<table border = 1>
<tr>
<th>Tarefas</th>
<th>Descrição</th>
<th>Prazo</th>
<th>Prioridade</th>
<th>Concluída</th>
<th>Opções</th>
</tr>
<?php if($lista_tarefas != null){
foreach ($lista_tarefas as $tarefa) : ?>
<tr>
<td><?php echo $tarefa["nome"]; ?></td>
<td><?php echo $tarefa["descricao"]; ?></td>
<td><?php echo traduz_data_para_view($tarefa["prazo"]); ?></td>
<td><?php echo traduz_prioridade($tarefa["prioridade"]); ?></td>
<td><?php echo traduz_concluida($tarefa["concluida"]); ?></td>
<td>
<a href="editar.php?id=<?php echo $tarefa["id"];?>">
Editar
</a>
</td>
</tr>
<?php endforeach;
};?>
</table>
</fieldset>
</form>
This started when I separated the form for better maintenance, the 3 forms are there!