Does my pdf generate without problems but when adding a conditional it stops working?

0

Hi, I'm giving permissions to my system, I generate a pdf by making queries to a database, it works perfect even when adding the if and validating the session start and the level of privilege of the user, but at the moment in which I use the else I get error 500 on my host, the code works and protects using only if it is really necessary to use else?

<?php
include_once 'resource/session.php';
include_once 'resource/Database.php';
include_once 'resource/utilities.php';
include_once 'partials/parseProfile.php';
include'fpdf/fpdf.php';

setlocale(LC_TIME,"es_ES");

 if(!(isset($_SESSION['username'])) || !$_SESSION['editar_coa'] == 1 ){

     echo"No tienes permisos para ver el coa";
 } 


    else{

// aqui van el codigo que genera mi pdf
$pdf->Output();
}
    
asked by Daniel Treviño 22.09.2017 в 18:36
source

1 answer

0

Try to see in the log file of your web server, or enable the errors in the client to be shown with something like:

ini_set('display_errors', 1);
error_reporting(E_ALL);    

Similarly if it is a fatal error it may not be displayed in the browser, the safest option is the error log of your web server.

Greetings

    
answered by 22.09.2017 в 23:23