Fw: Problemas para insetar datos de un Formulario
| From: | Gabriel Pirez | Date: | Tue, 11 Feb 2003 00:01:48 +0000 |
| Subject: | Fw: Problemas para insetar datos de un Formulario | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-32200@lists.php.net to get a copy of this message | ||
gracias por contestarme, pero todavia me salen mensajes de error:
--------------------------------------------------------------------------------
esta fue la respuesta:
> <html>
> <?php
> error_reporting (0); //Puedes poner esto...
>
> // o esto.
> $email = $_POST["email"];
> $submit = $_POST["submit"];
> // -----
>
> 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>
con la priemera opcion: error_reporting (0); (no obtengo mensajes de error pero no se realiza la
insercion).
con la segunda opcion obtengo el siguiente mensaje de error:
Notice: Undefined index: email in C:\Inetpub\wwwroot\sitiophp\formulariobase\input.php on line 3
Notice: Undefined index: submit in C:\Inetpub\wwwroot\sitiophp\formulariobase\input.php on line 4
Ayuda, plis...
Gracias
Gabriel