Php 如何找到哪一个;a「;已单击html元素
这个php文件查找每个“.html”文件和“.txt”文件,并创建一个动态表,其中包含指向另一个页面的链接。在该页面中,我希望在一个框架中显示单击的html文件Php 如何找到哪一个;a「;已单击html元素,php,html,Php,Html,这个php文件查找每个“.html”文件和“.txt”文件,并创建一个动态表,其中包含指向另一个页面的链接。在该页面中,我希望在一个框架中显示单击的html文件 <html> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=
<html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<body>
<?php
echo '<h2>Escolha o Esquema de MetaDados a utilizar</h2>';
echo '<table cellspacing="0" cellpadding="0" border="0" class="table">';
echo '<tr>';
echo '<th>Esquema de MetaDados</th>';
echo '<th>Descrição</th>';
echo '</tr>';
foreach (glob("Templates/Dinamico/*.html") as $filename) {
foreach(glob("Templates/Dinamico/*.txt") as $txtname){
$fileH= basename($filename,".html");
$fileT= basename($txtname,".txt");
if($fileH==$fileT){
$txt= file_get_contents ( $txtname);
if($filename != "Templates/Dinamico/formD1.html"){
echo'<tr>';
echo'<td>';
echo "<a name='".$fileH."'strong href='Templates/Dinamico/formD1.php'>".$fileH."</a>";
echo'</td>';
echo'<td>';
echo $txt;
echo'</td>';
echo'</tr>';
}
}
}
}
?>
</body>
</html>
您可以将id作为属性添加到该url,如下所示:
echo "<a name='".$fileH."'strong href='Templates/Dinamico/formD1.php?id=$fileH'>".$fileH."</a>";
echo”“;
然后在另一个页面中,只需使用$\u get['id']获取id代码>就是这样。
在这里可以找到有关如何传递变量的更多参考,或echo”“
我想这是将您发送到另一个页面的行是的,这是将我发送到另一个页面的行关于$a
它是什么?您从哪里获得它?这正是我希望单击的$fileH的值超出的地方。您可以将id作为属性添加到该url中,如下所示:echo”“
然后在您的另一个页面中,只需使用$\u get['id']获取id代码>就是这样
echo "<a name='".$fileH."'strong href='Templates/Dinamico/formD1.php?id=$fileH'>".$fileH."</a>";