php - 我们如何根据 ID 号创建临时页面并检索该 ID 号数据?
问题描述
我目前有一个包含人员数据的表格“candidatedetails”。如果我手动创建页面,我可以检索数据并在页面中显示。但是我不想手动创建每个页面。
我有每个人的链接:
echo '<td> <a href="'.$row['payroll_number'].'"><img src="images/document.jpg" height="30" > </a></td>';
这链接到作为 192.168.1.16/5100 的唯一 ID (payroll_number)(其中 5100 是本例中的工资单号)
我正在尝试使用以下内容,以便当单击上面的链接时,它会创建一个临时文件并转到一个 tmp 页面,在该页面中可以查看所有候选人的详细信息
`<?php
$temp = tmpfile();
fwrite($temp, file_get_contents("$path/$filename"));
//Rewind to the start of file
rewind($temp);
//Read 1k from file
echo fread($temp,1024);
//This removes the file
fclose($temp);
?>`
解决方案
推荐阅读
- java - 带有 Object.class 参数的 Class::getMethod 是如何工作的?
- python - 如何独立运行两个 onclick 函数(Python with turtle)
- .net - Xamarin Forms Tap Gesture 两次点击专门导致对象引用未设置为对象实例
- swift - Swift - MapView 重复注释
- c# - DbContext.Add 更改实体的属性值
- python - PyCharm 给出奇怪的结果,是内存/指针问题吗?
- python - Django 错误:必须使用切片将精确查找的 QuerySet 值限制为一个结果?
- postgresql - postgreSQL 数据库中的随机延迟。数据库复制可以处理它们吗?
- python - 如何使用 BeautifulSoup 抓取 Amazon IMG Alt 属性?
- javascript - 如何从一个 JS 文件中的 Input Slider 获取状态值到另一个 - ReactJS