A
Anonymous
Guest
Take a look to this code :
<?
if($submit)
{
echo entrou;
$db = mysql_connect("localhost", "parxal","sjrlop");
mysql_select_db("maillist",$db);
$sql = " INSERT INTO maillist (name,email,morada,url) values ('$nome','$email','$morada','$url') ";
echo "Thank you! Information entered.\n";
}
else
{
?>
<form name="form1" method="post" action="index.php">
<p>Nome :
<input type="text" name="nome">
</p>
<p>Morada:
<input type="text" name="morada">
</p>
<p>Email:
<input type="text" name="email">
</p>
<p>Url:
<input type="text" name="url">
</p>
<p>
<input type="submit" name="submit" value="Enter information">
</form>
<?
echo $nome;
}
?>
This is an html form, and his values are going to a database.
but, the variables are always empty, so de database records are empty!
when i right in the end echo $nome, $nome havent got ant value, why?
<input type="text" name="nome"> this should be tranform in $nome var?
<?
if($submit)
{
echo entrou;
$db = mysql_connect("localhost", "parxal","sjrlop");
mysql_select_db("maillist",$db);
$sql = " INSERT INTO maillist (name,email,morada,url) values ('$nome','$email','$morada','$url') ";
echo "Thank you! Information entered.\n";
}
else
{
?>
<form name="form1" method="post" action="index.php">
<p>Nome :
<input type="text" name="nome">
</p>
<p>Morada:
<input type="text" name="morada">
</p>
<p>Email:
<input type="text" name="email">
</p>
<p>Url:
<input type="text" name="url">
</p>
<p>
<input type="submit" name="submit" value="Enter information">
</form>
<?
echo $nome;
}
?>
This is an html form, and his values are going to a database.
but, the variables are always empty, so de database records are empty!
when i right in the end echo $nome, $nome havent got ant value, why?
<input type="text" name="nome"> this should be tranform in $nome var?