[HOME]

Path : /home/hermanostamargo/www/administracion/news/news/
Upload :
Current File : /home/hermanostamargo/www/administracion/news/news/lista.php

<?php
//ESTE ARCHIVO ES PARA EL AUTOCOMPLETAR, AL CREAR UNA PLANTILLA TIPO 10
//recibo variable
include $_SERVER['DOCUMENT_ROOT'] . "/defines.php";
include ("../includes/config.php");
include ("../includes/funciones.php");
$criterio = $_POST['criterio'];

//elimino espacios en blanco al principio y final

$cadena = trim($valor);

//conectamos con mysql y con la base de datos

$con_mysql=mysql_connect($HOSTNAME,$USERNAME,$PASSWORD);

if (!$con_mysql) {echo 'No se ha podido encontrar el servidor de datos';exit;}

mysql_select_db($DATABASE);

//consultamos los registros coincidentes

$select = "select * from bisionsuscripciones where nombre like '%$criterio%' or empresa like '%$criterio%' or email like '%$criterio%'";
$result=mysql_query($select) or die(mysql_error());

$str = "<ul>\n";

while ($row=mysql_fetch_array($result))
{
    $str .= "<li>\n";
    $str .= "<div class='tituloCompletar'>Nombre: <span class='m_nombre'>" . utf8_decode($row['nombre']) . "</span></div>";
    $str .= "<div class='tituloCompletar'>Empresa: <span class='m_empresa'>" . utf8_decode($row['empresa']) . "</span></div>";
    $str .= "<div class='tituloCompletar'>E-mail: <span class='m_email'>" . utf8_decode($row['email']) . "</span></div>";
    $str .= "<div class='tituloCompletar'>Id: <span class='m_id'>" . utf8_decode($row['id']) . "</span></div>";
    $str .= "</li>\n";
}

$str .= "</ul>\n";

echo utf8_encode($str);
?>