【发布时间】:2016-04-27 09:27:36
【问题描述】:
我只想点击一行,这样它会自动创建一个包含该特定行数据的新文件,并且该文件应该被自动下载。请帮我做这件事。
<html>
<head>
<title>Click on Particular Row fo MySql Table, then Create New File having data of that Row in PHP</title>
</head>
<body>
<table class="table table-striped table-hover" border="1" id="dataTable1" style="text-align: justify;margin-left:30px;">
<tr class="success" style="border-bottom: solid;border-top: solid;">
<th>
I.D.
</th>
<th>
Date
</th>
<th>
Website
</th>
<th>
E-Mail
</th>
<th>
Mobile Number(Head)
</th>
<th>
Courses
</th>
<th>
File
</th>
</tr>
<?php
while($row = mysqli_fetch_array($fetch))
{
?>
<tr>
<td>
<a href="Perticular.php?<?php echo $row['id']; ?>" target="_blank"><?php echo $row['id'];?></a> <!-- Want to Click on I.D. Such that Automatically Create New File having data of this whole Row -->
</td>
<td>
<?php echo $row['date_Time'];?>
</td>
<td>
<a href="<?php echo "http://".$row['website']; ?>" target="_blank"><?php echo $row['web_link'];?></a>
</td>
<td>
<?php echo $row['e_mail']; ?>
</td>
<td>
<?php echo $row['mobile_number']; ?>
</td>
<td>
<?php echo $row['courses_offer']; ?>
</td>
<td>
<a href="uploaded/<?php echo $row['file_Attach'];?>" target="_blank">View File</a>
</td>
</tr>
<?php
}
?>
</table>
</body>
</html>
【问题讨论】: