Tema: Sintaxis
Ver Mensaje Individual
  #6 (permalink)  
Antiguo 30/07/2012, 10:19
yonerflash
 
Fecha de Ingreso: noviembre-2004
Ubicación: Medellín
Mensajes: 121
Antigüedad: 19 años, 6 meses
Puntos: 1
Respuesta: Sintaxis

Corregí todo y puse un echo, pero no graba ni muestra el mensaje del echo, no hay mensaje de error esta vez, simplemente no pasa nada.

<body>
<p>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);

function ingresar(){
$link = mysql_connect('localhost', 'yonerflash', 'f740166');
if (!$link) {
die('No pudo conectarse: ' . mysql_error());
}
$database="admision";
@mysql_select_db($database) or die( "Unable to select database");

echo "Conectado";
$cedula=$_POST['texCedula'];
$nombres=$_POST['texNombres'];
$apellidos=$_POST['texApellidos'];
$correo=$_POST['texCorreo'];
mysql_query("insert into candidatos (cedula,nombres,apellidos correo) values ('$cedula','$nombres','$apellidos','$correo')", $link);
echo("Datos guardados");
mysql_close($link);
}
?>
</p>

<form action="" method="post" name="form1">
<p>
<label>
Cedula<br />
<input type="text" name="texCedula" id="texCedula" />
</label>

</p>
<p>
<label>
Nombres<br />
<input type="text" name="texNombres" id="texNombres" />
<span id="mensaje_nombres"></span>
</label>
</p>
<p>
<label>
Apellidos<br />
<input type="text" name="texApellidos" id="texApellidos"value="" />
<span id="mensaje_apellidos"></span>
</label>
</p>
<p>Correo<br />
<label>
<input type="text" name="texCorreo" id="texCorreo" />
</label>
</p>
<p>
<label>
<input type="button" name="butGuardar" id="butGuardar" value="Guardar" onclick="ingresar();"/>&nbsp;
</label>
<label>
<input type="button" name="butCancelar" id="butCancelar" value="Cancelar" />
</label>
</p>
</form>

<p>&nbsp;</p>
</body>