opening a pdf with php

liunx

Guest
I am trying to open a pdf file inside of a "secured" area using a php call to the file...

this is the url
<!-- m --><a class="postlink" href="http://www.domain.co.uk/assess.php?show_diploma1=0">http://www.domain.co.uk/assess.php?show_diploma1=0</a><!-- m -->

This is the error
Parse error: parse error in ../domain/printable/pdf/dip1.pdf on line 304

The files seem not to be opening as pdf's but trying to be read as php... Anyone got a clue how to deal?

Ta!You need to use require() instead of include().

require() won't need authorisation when passing .htaccess of whatever it is, include() will.

HTH

Cheers,

Dave
:rocker:so...
if i put the functions that call the pdfs into seprate files then require them... in the core file?what would i do to the .htaccess to make it pass?Nothing - it will do it automatically if you use require().in the core class - this is what I am doing:

function showPdf( $printable_name, $DATA = 0 ) {
if( !is_array($DATA) ) { $DATA = array( 'DATA'=>$DATA ); }
include( printablePATH.$this->printable_sub_directory.$printable_name.printableEXTN );
}

function show_bilan() {
$this->showPdf( "bilan" );
}


and in the assess.php - this:

if( isset($show_bilan) ) {
$ass->show_bilan( $bilan ); exit;
}

how do I require() them? What bit do i seperate out - and then how do i reintegrate, pls?yah - i saw it - I put require instead of include in the main function and still no joy...
 
Back
Top