consulta insercion
| From: | Gabriel Pirez | Date: | Sat, 08 Feb 2003 23:04:30 +0000 |
| Subject: | consulta insercion | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-32148@lists.php.net to get a copy of this message | ||
Amigos tengo este problema
el codigo es el siguiente:
<html>
<?php
if($submit)
{
$db = mysql_connect("localhost","daniel","datagroup");
mysql_select_db("promoweb",$db);
$sql = "INSERT INTO promoweb (E_MAIL) VALUES ('$email')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
}
else
{
?>
<form method="post" action="input.php">
<ul>
<li><strong>E-mail:</strong>
<input name="email" type="Text" value="alguien@datagroup.com"
size="50">
</li>
</ul>
<p align="center"><br>
<input type="Submit" name="submit" value="Ingresar mail">
</p>
</form>
<?
}
?>
</html>
lo que me devuelve el explorador es esto y no se realiza la insercion:
Notice: Undefined variable: email in C:\Inetpub\wwwroot\sitiophp\formulariobase\datain.php on line 5
Thank you! Information entered.
se supone que php deberia crear esta variable cuando se envia la informacion del formulario.
mi plataforma es win98 con pws,PHP 4.3.0 y edito codigo con dreamweaver mx.
gracias