这是代码
<?php
require('../fpdf/fpdf.php');
$pdf = new FPDF('P','in',"LEGAL");
include_once "../__accinfo.php";
$link_id=mysql_connect($dbhost, $dbusername, $dbuserpassword) or die("Unable To Connect To Server");
include_once "dbinfo.inc";
mysql_select_db($dbname) or die("Unable to Connect To Database");
$starting=$_POST['rno_start'];
$ending=$_POST['rno_end'];
$lmargin=0.5;
$rmargin=7.5;
$qry="select * from $dbname where `group`='$_POST[grp]' and inst_code=$_SESSION[INST_CODE] and not isnull(finalized) and serialno>=$starting and serialno<=$ending ORDER BY serialno ASC";
$result=mysql_query($qry, $link_id);
$grup="PRE-MEDICAL GROUP";
$countofrecords=9;
$title=1.0;
$cnt=0; $ln[0]=1.5;
while($cnt<10) {$cnt++;
$ln[$cnt]=$ln[$cnt-1]+1.1;
}
while($data=mysql_fetch_array($result))
{
$countofrecords=$countofrecords+1;
if($countofrecords==10) {
$countofrecords=0;
$pdf->AddPage();
$pdf->SetFont('Times','B',12);
$txt="BOARD OF INTERMEDIATE AND SECONDARY EDUCATION MULTAN";
$pdf->Cell(0,0,$txt,0,1,'C'); $pdf->ln(0.2);
$txt="REGISTRATION INTERMEDIATE (11th) 2013-15 $grup";
$pdf->Cell(0,0,$txt,0,1,'C'); $pdf->ln(0.3);
$txt="($_SESSION[INST_CODE]) $_SESSION[INST_NAME]";
$pdf->Cell(0,0,$txt,0,1,'C');
$pdf->rect($lmargin,1.0,$rmargin,11.5); //the main rectangle box
$cnt=-1;
while($cnt<9) {$cnt++;
$pdf->Line($lmargin,$ln[$cnt],$rmargin+.5,$ln[$cnt]);
}
$col1=$lmargin+.5; $col2=$col1+0.8; $col3=$col2+2.5;
$col4=$col3+0.8; $col5=$col4+0.7; $col6=$col5+1.3;
$pdf->Line($col1,$title,$col1,$ln[10]);
$pdf->Line($col2,$title,$col2,$ln[10]);
$pdf->Line($col3,$title,$col3,$ln[10]);
$pdf->Line($col4,$title,$col4,$ln[10]);
$pdf->Line($col5,$title,$col5,$ln[10]);
$pdf->Line($col6,$title,$col6,$ln[10]);
$pdf->SetFont('Times','B',10);
$pdf->Text($lmargin+.02,$title+.2,"College");
$pdf->Text($lmargin+.02,$title+.4," RNO");
$pdf->Text($col1+.1,$title+.2,"Date Of"); //$pdf->Text(3,3,"TEXT TO DISPLAY");
$pdf->Text($col1+.1,$title+.4,"Admission");
$pdf->Text($col2+.5,$title+.2,"Name / Father");
$pdf->Text($col3+.1,$title+.15,"SSC RNO");
$pdf->Text($col3+.1,$title+.30,"SESSION");
$pdf->Text($col3+.1,$title+.45,"BOARD");
$pdf->Text($col4+.1,$title+.2,"Subjects");
$pdf->Text($col5+.1,$title+.2,"B-Form / F-CNIC");
$pdf->Text($col5+.1,$title+.4,"/ Contact");
$pdf->Text($col6+.15,$title+.2,"Picture");
}
list($y,$m, $d) = split('[/.-]', $data["DOA"]);
$doa=$d."/".$m."/".$y;
$imgpath="studentpics/P$data[INST_CODE]$data[CRNO].jpg";
if(file_exists($imgpath))
$pdf->Image($imgpath,7.15,$ln[$countofrecords]+0.1,.75,.85);
$pdf->SetFont('Times','B',11);
$pdf->Text($col1+.05,$ln[$countofrecords]+0.2,$doa);
$pdf->Text($col3+.05,$ln[$countofrecords]+0.25,$data["MRNO"]);
$pdf->Text($col3+.02,$ln[$countofrecords]+0.5,$data["MSESSION"]);
$pdf->Text($col3+.05,$ln[$countofrecords]+0.75,$data["MBISE"]);
$pdf->Text($col5+.05,$ln[$countofrecords]+0.2,$data["CNIC"]);
$pdf->Text($col5+.05,$ln[$countofrecords]+0.5,$data["FCNIC"]);
$pdf->SetFont('Times','B',8);
$pdf->Text($col5+.05,$ln[$countofrecords]+0.75,$data["CONTACT"]);
$pdf->SetFont('Times','B',11);
$pdf->Text($lmargin+.15,$ln[$countofrecords]+0.3,$data["SERIALNO"]);
$pdf->Text($col2+.07,$ln[$countofrecords]+0.2,$data["NAME"]);
$pdf->Text($col2+.07,$ln[$countofrecords]+0.5,$data["FATHER"]);
$pdf->Text($col4+.02,$ln[$countofrecords]+0.2,$data["APPEAR4"]);
$pdf->Text($col4+.02,$ln[$countofrecords]+0.4,$data["APPEAR5"]);
$pdf->Text($col4+.02,$ln[$countofrecords]+0.6,$data["APPEAR6"]);
$pdf->Text($col4+.02,$ln[$countofrecords]+0.8,$data["APPEAR7"]);
if($data["APPEAR3"]!="IE")
$pdf->Text($col4+.15,$ln[$countofrecords]+0.8,$data["APPEAR3"]);
$pdf->SetFont('Times','B',10);
if($data["OREGNO"]!="")
$pdf->Text($col2+.1,$ln[$countofrecords]+0.75,"Prev. Reg# ".$data["OREGNO"]);
$pdf->SetFont('Times','B',8);
$pdf->Text($col1+.05,$ln[$countofrecords]+1,"Address: ".$data["ADDRESS"]);
}
$pdf->Text($lmargin+.5,13,"Signature _____________________");
$pdf->Text($rmargin-2,13,"Stamp _____________________");
$pg=$pdf->pageNo();
$pdf->Text($lmargin+3.1,13,"Page: $pg");
$filename="reg2013.pdf";
$pdf->Output($filename,'I');
?>
但页面未加载。 记住一件事。它在我的本地服务器上正常工作并正确生成输出。但是当我在互联网服务器上传脚本时,它不会显示任何输出。
答案 0 :(得分:0)
该程序至少三个外部依赖项:
../fpdf/fpdf.php
../__accinfo.php
dbinfo.inc
它们都在不同的目录中。你确定这两台机器都匹配了吗?然后包括等等的一切?
更多:
这些线条按原样排序似乎很奇怪:
$link_id=mysql_connect($dbhost, $dbusername, $dbuserpassword) ...
include_once "dbinfo.inc";
$db
*变量定义在哪里? (希望在../__accinfo.php
。)
答案 1 :(得分:0)
检查您的dbhost,dbusername和dbpassword(如果它对应于您的Internet服务器
)常见的错误是未能将数据从本地服务器数据更新为互联网服务器数据
mysql_connect($dbhost, $dbusername, $dbuserpassword)