hi frens

I am trying to pass array in $_SESSION from the abc.php to generatepdf.php. the pdf is not getting generated after i wrote this part of code.

this is in generatepdf.php

foreach($_SESSION['refcode'] as $temp)
{
	$refcode[]=$temp;
}

foreach($_SESSION['description'] as $temp)
{
	$description[]=$temp;
}

foreach($_SESSION['unit'] as $temp)
{
	$unit[]=$temp;
}

foreach($_SESSION['quantity'] as $temp)
{
	$quantity[]=$temp;
}

foreach($_SESSION['rate'] as $temp)
{
	$rate[]=$temp;
}

foreach($_SESSION['total'] as $temp)
{
	$total[]=$temp;
}

for($i=0;$i<=count($_SESSION['quantity']);$i++)
{
	$pdf->Cell(13,7,$i+1,1);
	$pdf->Cell(30,7,$refcode[$i],'TRB');
	$pdf->Cell(60,7,$description[$i],'TRB');
	$pdf->Cell(10,7,$unit[$i],'TRB');
	$pdf->Cell(10,7,$quantity[$i],'TRB');
	$pdf->Cell(30,7,$rate[$i],'TRB');
	$pdf->Cell(30,7,$total[$i],'TRB',1);

}

any idea, where i am going wrong??
any suggestions most appreciated.

thanks

Hi puvi,
Do you have session_start() in your generatepdf.php ?

hey paulrajj, thanks for the reply.

i had included session_start(), did not have any output or echo before header tag, but even then i had this problem.

i tried lot many things but in vain, lastly, i had a backup of last working version fortunately, just replaced it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.