1
In the browser of the following error, I have tried everything if you can help
Parse error: syntax error, Unexpected $end, expecting T_VARIABLE or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN in
<?php
echo "NOVO MOTORISTA";
include('conexao.php');
if(isset($_POST['submitted'])){
foreach($_POST AS $key=>$value){$_POST[$key] = mysql_real_escape_string($value);}
$sql = "INSERT INTO 'motoristas'('cod_mot', 'nome', 'endereco', 'cidade','cod_veiculo')
VALUES('{$_POST['cod_mot']}', '{$_POST['nome']}, '{$_POST['endereco']}, '{$_POST['cidade']}, '{$_POST['cod_veiculo']}')";
mysql_query($sql) or die(mysql_error());
echo "registro adicionado.<br/>";
echo "<a href='listar_m.php'>Voltar à listagem</a>;
}
?>
<html>
<form action= method='POST'>
<p><b>Cod Mot:</b><br/><input type='text' name='cod_mot'/>
<p><b>Nome:</b><br/><input name='nome' type='text' size= '50'/>
<p><b>Endereco:</b><br/><input name='endereco' type='text' size='50'/>
<p><b>Cidade:</b><br/><input name='cidade' type='text' size='50'/>
<p><b>Cod Veiculo:</b><br/><input type='text' name='cod_veiculo'/>
<p><input type='submit' value='Salvar'/><input type='hidden' value='1' name='submitted'/>
</form>
Edit your post and post your code, please!
– Thiago Cunha
The error message does not appear to be complete, and there is no code referring to the error, such as the variable
$end
mentioned in the error– Isac