TottoBennington Posted February 4, 2012 Share Posted February 4, 2012 When i touch the button that i've called "submit", the form dissapear and nothing happens. Later i saw the localhost, but VALUES , are not in the table . $submit = @ $_POST['submit']; if ($submit) { $nombre = strtolower( strip_tags(@ $_POST['nombre'])); $apellido = strtolower( strip_tags( @ $_POST['apellido'])); $tel = strip_tags(@ $_POST['telefono']); $email = strip_tags(@ $_POST['email']); $ubicacion = strtolower( strip_tags( @ $_POST['ubicacion'])); $opcion = @ $_POST['opcion']; $especificacion = strtolower( strip_tags( @ $_POST['especificacion'])); $explicación = strtolower( strip_tags( @ $_POST['explicacion'])); if (!empty($nombre) && !empty($apellido) && !empty($email) && !empty($tel) && !empty($ubicacion) && !empty($opcion) && !empty($especificacion) && !empty($explicacion)) { mysql_connect ("localhost","root","") or die (mysql_error()); mysql_select_db("pedidos") or die (mysql_error()); $date = date ("Y-m-d"); $insert = mysql_query ("INSERT INTO pedidos_recibidos VALUES ('','$nombre','$apellido','$tel','$email','$ubicacion','$opcion','$especificacion','$explicacion','$date')") or die (mysql_error()); echo 'works!'; } else { echo "please fill otu all the fields"; } } ?> <html> <table id='encargo2' > <form action='index.php' method='POST'> <tr> <td> Nombre: </td> <td> <input type='text' name='nombre' value=''> </td> </tr> <tr> <td> Apellido: </td> <td> <input type='text' name='apellido' value=''> </td> </tr> <tr> <td> Telefono: </td> <td> <input type='text' name='apellido' value=''> </td> </tr> <tr> <td> email: </td> <td> <input type='text' name='email' value=''> </td> </tr> <tr> <td> Localidad o ubicación: </td> <td> <input type='text' name='ubicacion'> </td> </tr> <tr> <td> Deseo una web para: </td> <td> <select name='opcion'> <option></option> <option value='almacen'>Almacen o negocio</option> <option value='empresa'>Empresa</option> <option value='club'>Club de barrio</option> <option value='emprendimiento'>Emprendimiento personal</option> <option value='otro'>Otro</option> </select> </td> </tr> <tr> <td> Si eligio opción "Otro",<br /> especifique con detalles para que: </td> <td> <textarea cols='20' rows='5' name='especificacion'></textarea> </td> </tr> <tr> <td> Explique con sus palabras<br /> como quiere que sea la página: </td> <td> <textarea cols='20' rows='5'name='explicacion'></textarea> </td> </tr> </table> <p> <input type='submit' name='submit' value='Enviar Pedido'> </form> </html> Quote Link to comment https://forums.phpfreaks.com/topic/256400-cant-insert-values-into-the-table-no-error-message/ Share on other sites More sharing options...
sunfighter Posted February 5, 2012 Share Posted February 5, 2012 You have a number of coding errors like no doc deceleration, no body or head tags, but the biggest is no start <?php as the first line. Quote Link to comment https://forums.phpfreaks.com/topic/256400-cant-insert-values-into-the-table-no-error-message/#findComment-1314784 Share on other sites More sharing options...
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.