Hey all,
this is a big annoying confusing problem…so lets start:
First off i have a mysql query which displays 20 random words in a table.
The words are contained in the variable $r[‘words’] words being my table column in the database.
So what i want to do now is capture those exact 20 random words in a variable and send that variable with those 20 words to another php page.
On this php page i create a pdf using php which works fine and if i type a just normal text it shows in the pdf…but rather than typing normal text i want the variable and the 20 words to display in the pdf.
if anybody has any ideas on how to get my 20 words into a variable and into the other page i should be able to handle the rest.
I’ll post some code below aswell:
The first page php code and mysqlquery:
<?php require_once('Connections/myconnection.php'); ?>
<?php
$sql = mysql_query("SELECT * FROM mytable ORDER BY RAND() LIMIT 20") or die(mysql_error());
echo '<table width="466" height="256" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>';
for($x=0; $r = mysql_fetch_assoc($sql); $x++){
if($x == 4){
echo '</tr><tr>';
$x=0;
}
echo '<td width="116.5" height="30" align="center" class="style2">'.$r['words'].'</td>'."
";
}
echo '</tr>
</table>';
?>
that puts the query and the 20 words into a table
now is the pdf creating php page:
<?php
include('class.ezpdf.php');
switch ($_GET['type'])
{
default : $pdf = new backgroundPDF('a4', 'portrait', 'image', array('img' => 'pdfbg.jpg')); break;
case '1' : $pdf = new backgroundPDF('a4', 'portrait', 'colour', array('r' => 0.5, 'g' => 0.4, 'b' => 0.8)); break;
}
$pdf->selectFont('Helvetica.afm');
$pdf->ezText('this is the normal text i want to replace with my variable', 50);
$pdf->ezStream();
?>
So any ideas??
Thanks in advance