Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/03/2014, 09:02
el__tamer
 
Fecha de Ingreso: diciembre-2013
Mensajes: 81
Antigüedad: 10 años, 4 meses
Puntos: 1
Conexion y Seguridad a la BD EN PHP

BUENOS DIAS
ME GUSTARIA QUE ME AYUDARAN CON LA CONEXION Y SEGURIDAD AL CONECTARME A LA BD.

USO LOCALHOST Y EN EL TRABAJO ME PIDIERON USAR UNA CONEXION A LA BD

LES PARECE QUE TENGA BUENA CONEXION ESTE CODIGO (FUNCIONA SI )

Código PHP:
<?php
$con
=mysql_connect("localhost","root","");
$bd=mysql_select_db("cosmos");


//Convierto los acentos a HTML
function chao_tilde($entra)
{
$traduce=array( 'á' => '&aacute;' 'é' => '&eacute;' 'í' => '&iacute;' 'ó' => '&oacute;' 'ú' => '&uacute;' 'ñ' => '&ntilde;' 'Ñ' => '&Ntilde;' 'ä' => '&auml;' 'ë' => '&euml;' 'ï' => '&iuml;' 'ö' => '&ouml;' 'ü' => '&uuml;');
$sale=strtr$entra $traduce );
return 
$sale;
}

?>
Y EL TEMA DE SEGURIDAD SERIA ESTE
Código PHP:
<?PHP
   session_start 
();
   if (!isset(
$_SESSION['usuario']))
   { 
header("location:../index.html"); }
?>
ESPERO QUE ME DEN OPINIONES O AYUDA
MUCHAS GRACIAS.