Jump to content

PHP and FPDF


eddy556

Recommended Posts

I'm having trouble with this code, I am trying to use sessions with FPDF, I have already had this script working but changed it somehow lol and cant get it back, I keep getting header already sent problems.
THanks


<?php
require ("fpdf.php");

$date = date('l dS \of F Y');


$pdf=new FPDF();

session_start();

$userID = $_SESSION['userid'];

$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,"Planes R' Us Invoice");
$pdf->Ln(6);

$pdf->SetFont('Courier','B',8);
$pdf->SetXY(120, 30);
$pdf->Cell(40,5, 'Invoice created on:');

$pdf->SetFont('Courier','',8);
$pdf->SetXY(120, 30);
$pdf->Cell(40,10, $date);

$pdf->SetFont('Courier','B',8);
$pdf->SetXY(120, 30);
$pdf->Cell(40,20, 'By user:');

$pdf->SetFont('Courier','',8);
$pdf->SetXY(120, 30);
$pdf->Cell(40,25, $userID);


$pdf->Output();


?>
Link to comment
https://forums.phpfreaks.com/topic/28860-php-and-fpdf/
Share on other sites

  • 5 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.