Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-01-2011, 06:33 PM   PM User | #1
cswart777
New Coder

 
Join Date: Aug 2011
Posts: 11
Thanks: 3
Thanked 0 Times in 0 Posts
cswart777 is an unknown quantity at this point
CReate Multiple PDF Documents With PHP While

Please assist, im trying to create a script that will automatically generate a pdf document and then move to next record and generate a new pdf based on the data,
when i run the script the browser displays a blank page.

<?php
mysql_select_db($database_traces, $traces);
$query_rsTraceps = "SELECT * FROM traceps ORDER BY sfref";
$rsTraceps = mysql_query($query_rsTraceps, $traces) or die(mysql_error());
$row_rsTraceps = mysql_fetch_assoc($rsTraceps);
while ($row_rsTraceps = mysql_fetch_array($rsTraceps))
{
$value1 = $row_rsTraceps['sfref'];
require ('fpdf.php');
$pdf = new FPDF('P', 'mm', 'A4');
$pdf -> AddPage();
$pdf -> SetFont ('Arial','B', 10);
$pdf-> Image('traceps.jpg',10,6,50);
$pdf -> Ln(40);
$pdf -> Cell (25,5,"Reference :");
$pdf -> Cell (80,5,$row_rsTraceps['sfref'] ,1);
$pdf -> Ln(10);
}
cswart777 is offline  
Old 09-01-2011, 07:05 PM   PM User | #2
dnnhater
New Coder

 
Join Date: Jul 2011
Location: Sunshine State
Posts: 79
Thanks: 18
Thanked 0 Times in 0 Posts
dnnhater is an unknown quantity at this point
PHP Code:
<?php
mysql_select_db
($database_traces$traces);
$query_rsTraceps "SELECT * FROM traceps ORDER BY sfref";
$rsTraceps mysql_query($query_rsTraceps$traces) or die(mysql_error());
$row_rsTraceps mysql_fetch_assoc($rsTraceps);
while (
$row_rsTraceps mysql_fetch_array($rsTraceps))
{
$value1 $row_rsTraceps['sfref'];
require (
'fpdf.php');
$pdf = new FPDF('P''mm''A4');
$pdf -> AddPage();
$pdf -> SetFont ('Arial','B'10);
$pdf-> Image('traceps.jpg',10,6,50);
$pdf -> Ln(40);
$pdf -> Cell (25,5,"Reference :");
$pdf -> Cell (80,5,$row_rsTraceps['sfref'] ,1);
$pdf -> Ln(10);
}
in the snippet you've provided there is no closing php tag - ?>
dnnhater is offline  
Old 09-02-2011, 04:12 AM   PM User | #3
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Quote:
Originally Posted by dnnhater View Post
in the snippet you've provided there is no closing php tag - ?>
A closing tag is not required and often times people omit them intentionally to prevent spaces at the end of the file from causing the headers to be sent prematurely. This thread is a dupe, though. Closing.
Inigoesdr is offline  
Closed Thread

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:45 AM.


Advertisement
Log in to turn off these ads.