read a HTML row
Posted: Fri Nov 20, 2009 10:22 am
Hi there, I have written down a PHP program to read a Server folder, just I am using FTP statement to do that, I am reading the folder and move the files to an array, that array has been moved into a HTML TABLE using the FOREACH() PHP statemen, all those files are PDF and my goal is read every one of them and open that file, the problems is that when I click on a row the last table record is opne and not the row selected
I need to get a way to read the HTML table and get the correct file name
thank in advance
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link href="css/css1.css" rel="stylesheet" type="text/css">
<h1>FGPO's FOLDER</h1>
</head>
<body >
<?php
include("FTP.php");
$filesArr=xp($filesArr,$connect );
?>
<form method="POST" action="showpdf.php">
<div id="scrolltable" >
<table class="tabla" border="1" >
<tr class="header">
<th>Sequence #</th>
<th>File Name</th>
<th>View </th>
</tr>
<?php foreach($filesArr as $k => $value) {
?>
<tbody >
<tr class="detail">
<td onmouseover='this.style.background="#cc0000"' onmouseout='this.style.background="white"' ><?php echo $k ;?></td>
<td onmouseover='this.style.background="#cc0000"' onmouseout='this.style.background="white"' ><?php echo $value ;?></td>
<td ><input value="<?php echo $value ?>" type="hidden" name="accion" value="<?php echo $value;?>">
<input type="submit" value="View"</td>
</tr>
</tbody>
<?php }
ftp_close($connect);
?>
</table>
</div>
I need to get a way to read the HTML table and get the correct file name
thank in advance
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link href="css/css1.css" rel="stylesheet" type="text/css">
<h1>FGPO's FOLDER</h1>
</head>
<body >
<?php
include("FTP.php");
$filesArr=xp($filesArr,$connect );
?>
<form method="POST" action="showpdf.php">
<div id="scrolltable" >
<table class="tabla" border="1" >
<tr class="header">
<th>Sequence #</th>
<th>File Name</th>
<th>View </th>
</tr>
<?php foreach($filesArr as $k => $value) {
?>
<tbody >
<tr class="detail">
<td onmouseover='this.style.background="#cc0000"' onmouseout='this.style.background="white"' ><?php echo $k ;?></td>
<td onmouseover='this.style.background="#cc0000"' onmouseout='this.style.background="white"' ><?php echo $value ;?></td>
<td ><input value="<?php echo $value ?>" type="hidden" name="accion" value="<?php echo $value;?>">
<input type="submit" value="View"</td>
</tr>
</tbody>
<?php }
ftp_close($connect);
?>
</table>
</div>