Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/01/2013, 15:23
Avatar de alfredox91
alfredox91
 
Fecha de Ingreso: noviembre-2012
Ubicación: Venezuela-Turmero- Aragua
Mensajes: 17
Antigüedad: 11 años, 5 meses
Puntos: 0
problema al conectar formulario php con base de datos mysql

buenas, he creado un formulario php para que envíe datos a una BD, el formulario lo tengo almacenado en mi cuenta de hostinazo.com a traves de la herramienta filemanager que proporciona el mismo hosting, la base de datos también la cree con phpmyadmin a través del panel de control, el asunto es que cuando le doy a abrir al archivo php e intento mandar los datos me sale esto:



(ABRIR LA IMAGEN EN NUEVA PESTAÑA PARA QUE SE VEA COMPLETA)

este es el código del formulario en cuestión

<!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>Documento sin título</title>
</head>
<?php
$nombre=$_POST['nombre'];
$email=$_POST['email'];

if ($nombre!= "" && $email!="" )
{
mysql_connect("nombre del servidor","usuario","contraseña");
mysql_select_db("nombre de la BD");

mysql_query("INSERT INTO tabla(nombre,email) VALUES('$nombre','$email')");

}
?>

<body>
<form id="form1" name="form1" method="post" action="">
<table width="485" border="4">
<tr>
<td width="228">nombre</td>
<td width="392"><label for="nombre"></label>
<input type="text" name="nombre" id="nombre" /></td>
</tr>
<tr>
<td>email</td>
<td><label for="email"></label>
<input type="text" name="email" id="email" /></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="button" id="button" value="Enviar" />
</div></td>
</tr>
</table>
</form>
</body>
</html>

si alguien me pudiera ayudar estaria muy agradecido soy novicio en esto, gracias de antemano