• 0
Sign in to follow this  
lucas.rodrigues

Ajuda por favor?

Question

Primeira mente obrigado pelo seu tempo

Olha queria saber o que esta acontecendo nesse meu fonte, parece perfeito mas não funciona

quanto eu clico no botao ENVIAR nada acontece.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Projeto</title>
</head>

<body>
<form action="gravar.php" method="post">
Nome:<input type="text" name="nome"/>
<input type="submit"/>
</form>
</body>
</html>
E aqui esta a parte do php
<?
$db_local ="localhost:3306";
$db_login ="root";
$db_senha ="";

$con = mysql_connect($db_local, $db_login, $db_senha);

mysql_select_db("lucas",$con);

if(!$con) 
{
        die ('Failed to connect to server: ' . mysql_error());
}

$nome = $_POST['nome'];

$sql="INSERT INTO users (NOME) VALUES ($nome)";

if(!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
else{
echo "1 record added";
}
mysql_close($con);
?>

Se alguém souber o que é e me informar eu agradeço

t+

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this