Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/08/2015, 17:34
joscol
 
Fecha de Ingreso: marzo-2015
Ubicación: zulia
Mensajes: 71
Antigüedad: 9 años, 1 mes
Puntos: 0
Pregunta alguien que me ayude con este error a la hora de ingresar los datos en la base de dat

tengo este formulario
Código PHP:
<html>
<
head>
<
title>nuevo consejo</title>
</
head>
<
body>
<
form action="funcion.php" method="POST">
<
label>RIF:</label><br>
<
input type="text" name="rif" required><br><br>
<
label>Nombre:</label><br>
<
input type="text" name="nombre" required><br><br>
<
label>Direccion:</label><br>
<
textarea name="direccion" cols="21" rows="5"></textarea required><br><br>
<
label>telefono:</label><br>
<
input type="text" name="telefono" required><br><br>
<
label>correo:</label><br>
<
input type="email" name="correo" required><br><br>
<
input type="submit" value="Registrar">

</
form>
</
body>
</
html

que tiene esta funcion



Código PHP:
<?php
include("conex.php");
if(isset(
$_POST['rif']) && !empty($_POST['rif']) &&
(isset(
$_POST['nombre']) && !empty($_POST['nombre']) &&
(isset(
$_POST['direccion']) && !empty($_POST['direccion']) &&
(isset(
$_POST['telefono']) && !empty($_POST['telefono']) &&
(isset(
$_POST['correo']) && !empty($_POST['correo']))
{
    
$conexion mysql_connect($host,$user,$pw)or die("problema al conectar con el servidor");
    
mysql_select_db($bd,$conexion)or die("problema al conectar con la base de datos");
    
    
mysql_query("INSERT INTO consejo (rif,nombre,direccion,telefono,correo)
    VALUES ('$_POST[rif]','$_POST[nombre]','$_POST[direccion]','$_POST[telefono]','$_POST[correo]')"
,$conexion);
    echo 
'<script type="text/javascript">
    alert("Datos Introducidos Correctamente");
    window.location.href="./administrador/index.php";
    </script>'
}else{'<script type="text/javascript">
    alert("Los datos no se han podido introducir");
    window.location.href="./administrador/index.php";
    </script>'
    
}

?>

con esta conexion



Código PHP:
<?php

$host 
"localhost";
$user "root";
$pw "";
$db "jornada";

?>

en el segundo archivo a la hora de ingresar la información y registrar los datos me da este error
Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\Jornada\administrador\consejos\fun cion.php on line 8


gracias de antemano.