hi, everyone, i have a question abbout pdf and php. I use php , mysql and ajax in my page. After upload the pdf files i go in this page and get to data in table with paging. My question is hot to load the pdf files in same page when click the filepath on the table. What should i to add in the php where is

<td class='download'>".$row['filepath']."</td>

and what to add where is <div>reader</div> to view the pdf and save the file from there if i want ?

body>
<div class="h3" style="text-align:left;">Уроци по Български език 1 клас</div>
<div > 
reader
</div>

<br />
<div>
<table border="1" width="750" cellpadding="0" cellspacing="3" class="pageme">
	<tbody>
<?php
include"actionpages/dbconnect.php";
	$sql="SELECT * FROM account_file WHERE class='Iклас' AND subject='Български език' ORDER BY date DESC";
	$result=mysql_query($sql) or die(mysql_error());
	if(mysql_num_rows($result)==0)
	{ print "<span style='font-size:15px;'>Не сте прикачвали файлове.</span>"; }
	else{
	while($row = mysql_fetch_array($result))
	{
		print "<tr>
				<td class='lesson'>".$row['lesson']."</td>
				<td class='date'>".$row['date']."</td>
				<td class='download'><a  ref=".$row['filepath'].">Отвори</a></td>
			</tr>";
	}
	}
?>
	</tbody>
</table>
<div class="pager"></div>
</div>
<br /><br />

thanks in advance

You want to display a PDF in a div you specify, is that correct ?

If so, I don't think it is possible, because it depends on the browser whether it can handle PDF files.

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.