\n";
echo "\n"
. ""
. "";
echo "";
exit;
}
?>
$nombre_tabla = "productos";
$nombre_tabla2 = "fotosproductos";
$nombre_tabla3 = "users";
$nombre_tabla_noticias = "noticias";
$nombre_tabla_imagenes_noticias ="imagenesnoticias";
$nombre_tabla_anuncios = "anuncios";
$nombre_tabla_imagenes_anuncios ="imagenesanuncios";
$nombre_tablausuarios = "users";
$host = "localhost";
$nombreusuario = "goletaponte";
$clave = "palitogol";
$basededatos = "goletabase";
$conexion = mysql_connect($host, $nombreusuario, $clave) or die ('No puedo conectar porque: ' . mysql_error());
mysql_select_db($basededatos, $conexion)or die ("No se puede conectar a la base de datos especificada");
?>
if (!isset($PHP_AUTH_USER) || !isset($PHP_AUTH_PW)) {
// If username or password hasn't been set, display the login request.
displayLogin();
} else {
// Escape both the password and username string to prevent users from inserting bogus data.
$PHP_AUTH_USER = addslashes($PHP_AUTH_USER);
$PHP_AUTH_PW = md5($PHP_AUTH_PW);
// Check username and password agains the database.
$result = mysql_query("SELECT count(id) FROM users WHERE password='$PHP_AUTH_PW' AND username='$PHP_AUTH_USER'") or die("Couldn't query the user-database.");
$num = mysql_result($result, 0);
if (!$num) {
// If there were no matching users, show the login
displayLogin();
}
}
// All code/html below will only be displayed to authenticated users.
?>