EllisLab text mark
Advanced Search
     
Include Path Error In FPDF
Posted: 08 October 2012 12:50 AM   [ Ignore ]
Avatar
Joined: 2012-08-24
214 posts

hey guys I am generating a PDF file out of FPDF library. just want to ask what is my error in my code below this is my sample code:

<?php
 
include('/fpdf/fpdf.php');
 
    
$pdf = new FPDF();
    
$pdf->AddPage();
    
$pdf->SetFont('Arial','B',16);
    
$pdf->Cell(40,10,'Hello World!!');
    
$pdf->Ln();
    
$pdf->Output();
?> 

because when I attempt to run this code in my view it shows

Fatal error: require(): Failed opening required 'http://localhost/eMLM/fpdf/fpdf.php' (include_path='.;C:\\\\\\\\xampp\\\\\\\\php\\\\\\\\PEAR'in C:\xampp\htdocs\eMLM\application\views\sites\datepdf.php on line 3 

Where should i put the file of fpdf? Inside my folder which is eMLM or inside of htdocs? I cant’ get the path. Help me guys. But when i try to create a seperate folder that contains a pdf file test.pdf it shows the PDF file. By the way I also tried full path and relative path but it always shows the error above.

 Signature 

Our greatest glory is not in never falling, but in rising every time we fall.

cheese
Email: .(JavaScript must be enabled to view this email address)
Mobile Number: +639216015372

 
Posted: 19 October 2012 03:36 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2011-01-21
42 posts

cannot help you but i can give you an idea :
since TCPDF is successor for FPDF i suggest you to use TCPDF since it fully support for PHP5,

you can start here :
hxxp://modije.in/blog/?p=14