<?php
// Incluimos la configuracion y conexion a la MySQL.
include('config.php');
// Definimos la variable $msg por seguridad.
$msg = "";
// Si se apreta el boton Agendar, da la condicion como true.
if($_POST['agendar'])
{
// Verificamos que no alla ningun dato sin rellenar.
if(!empty($_POST['nombre']) || !empty($_POST['dpto']) || !empty($_POST['telefono']) || !empty($_POST['movil']) || !empty($_POST['abreviado']) || !empty($_POST['cedula']) || !empty($_POST['usuario']))
{
// concatenar
$uno="\\red\foto\";
$dos=".JPG";
// Pasamos los datos de los POST a Variables, y le ponemos seguridad.
$dos =".JPG";
$nombre = htmlentities($_POST['nombre']);
$dpto = htmlentities($_POST['dpto']);
$telefono = htmlentities($_POST['telefono']);
$movil = htmlentities($_POST['movil']);
$abreviado = htmlentities($_POST['abreviado']);
$cedula = htmlentities($_POST['cedula']);
$usuario = htmlentities($_POST['usuario']);
$rela=$UNO. $cedula . $dos; aca esta el error
// Insertamos los datos en la base de datos, si da algun error lo muestra.
$sql = "INSERT INTO telefono (nombre, dpto, telefono, movil, abreviado, cedula, usuario,foto) VALUES ('".$nombre."','".$dpto."','".$telefono."', '".$movil."', '".$abreviado."', '".$cedula."', '".$usuario."','".$rela."')";
mysql_query($sql,$link) or die(mysql_error());
// Mostramos un mensaje diciendo que todo salio como lo esperado
$msg = "Persona agendada correctamente";
} else {
// Si hay un dato sin rellenar mostramos el siguiente texto.
$msg = "Falta un dato por llenar";
}
}
?>