Pořád stále mám problém s tím že nevím kde mám problém.. Nefunguje mi mazání řádků a nemohu najít problém...
<head>
<meta charset=UTF-8>
<head>
<?php
// počet řádků v souboru
$radky = file('./Cxp9_data_001.txt');
$lines = count($radky);
echo '<label><b>Počet řádků v Souboru:</b></label>' . ' ' . $lines . ' ';
?>
<br>
<?php
/*
* Default Location Data File TXT:./Cxp9_data_001.txt
*/
if (isset($_POST['index']) && is_array($_POST['index'])) {
$radky = file('./Cxp9_data_001.txt');
foreach ($_POST['index'] as $klic => $hodnota) {
$radky[$hodnota] = '';
}
$text = join('', $radky);
$file_put_contents('./Cxp9_data_001.txt', $text);
}
$radky = file('./Cxp9_data_001.txt');
?>
<!--zacatek--!>
<?php
/*
* PHP pro výpis tabulky, + mazani, + editace.
*
*/
// format: echo "";, echo '';
for ($i = 0; $i < count($radky); $i++) {
$row = explode("|", $radky[$i]);
echo "<table style=\"width:900;border-width:0;\"><tr>\n";
echo "<td width= 1% class=TDL nowrap style=\"border-width:0;background-color:white;font-size:15;\">" . ($i + 1) . ".</td>\n";
echo "<td width=14% class=TDL nowrap style=\"border-width:0;background-color:white;font-size:15;\">" . trim($row[0]) . "</td>\n";
echo "<td width=25% class=TDL nowrap style=\"border-width:0;background-color:white;font-size:15;\"><a href=mailto:" . trim($row[1]) . ">" . trim($row[1]) . "</a></td>\n";
echo "<td width=25% class=TDL nowrap style=\"border-width:0;background-color:white;font-size:15;\">" . trim($row[2]) . "</td>\n";
echo "<td width=38% class=TDL nowrap style=\"border-width:0;background-color:white;font-size:15;\">" . trim($row[3]) . "</td>\n";
echo "<td width=41% class=TDL nowrap style=\"border-width:0;background-color:white;font-size:15;\">" . trim($row[4]) . "</td>\n";
echo "<td width=45% class=TDL nowrap style=\"border-width:0;background-color:white;font-size:15;\">" . trim($row[5]) . "</td>\n";
echo "<td width=46% class=TDL nowrap style=\"border-width:0;background-color:white;font-size:15;\">" . trim($row[6]) . "</td>\n";
echo "<td width=48% class=TDL nowrap style=\"border-width:0;background-color:white;font-size:15;\">" . trim($row[7]) . "</td>\n";
echo "<td width=49% class=TDL nowrap style=\"border-width:0;background-color:white;font-size:15;\">" . trim($row[8]) . "</td>\n";
echo "<td width=50% class=TDL nowrap style=\"border-width:0;background-color:white;font-size:15;\">" . trim($row[9]) . "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo ' '.$radky[$i].'><label><br><input type="checkbox" name="index[]" value="'.$i.'">Vyber pro smazání záznamu</label><br>'."";
echo '<p align="right"><input type="submit" name="sub" value="Smazat vybraný řádek"></p><hr>';
echo "<td width= 1% class=TDL nowrap ></td>\n";
echo "</tr></table><br />\n";
}
?>