si le agrego el archivo funciones.php aparece el mensaje de que el servidor me reedirigio muchas veces
error.php
Código HTML:
Ver original
<?php require 'funciones.php'; $id = isset($_GET['id']) ? (int)$_GET['id'] : false; ?> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <link href="https://fonts.googleapis.com/css?family=Slabo+27px" rel="stylesheet"> <link rel="stylesheet" href="css/estilos.css"> </head> <body> <?php if(!$id): ?> <div style="font-size: 80px; text-align: center; position: relative; top: 35%;"> </div> <div style="font-size: 23px; text-align: center; position: relative; top: 36%;"> </div> <?php endif ?> <?php if(!$conexion): ?> <div style="font-size: 80px; text-align: center; position: relative; top:35%;"> </div> <div style="font-size: 23px; text-align: center; position: relative; top:36%;"> </div>--> <?php endif ?> </body> </html>
funciones.php
Código PHP:
Ver original
<?php function conexion($db, $usuario, $pass){ try { $conexion = new PDO("mysql:host=localhost;dbname=$db", $usuario, $pass); return $conexion; } catch (PDOException $e) { return false; } } $conexion = conexion('galeria', 'root', ''); if (!$conexion) { } ?>