Hey, its just a small bit of code i need which opens up 'Data.txt' and then shows a Check box with the string. Then when you click the 'Deleted' button it will remove every string from the txt which you check....... and it works but when i select more than 3 it dosnt work![]()
Heres the code for the main file but if you dont understand just download the zip it has the Data.txt file too
PHP Code:<html><body>
<FORM NAME="Testin" ACTION="Guest Del.php" METHOD=POST><br>
<?
$Data = file("Data.txt");
for ($i = 0; $i <= count($Data)-1; $i++) {
if ((substr($checkd[$i],0,3) == "Sel") && ($Data[substr($checkd[$i],4,1)] == $Data[$i])) {
$Deleted .= "$Data[$i] <BR>";
$Data[$i] = "";
$checkd[$i] = "";
$NData = join("",$Data);
$blah2 = fopen("Data.txt", "w");
fwrite($blah2, "$NData");
fclose($blah2);
$Data = "";
$Data = file("Data.txt");
}
if (($Data[$i] != "") && (substr($Data[$i],0,2) != "\n")) { echo "<INPUT TYPE=CHECKbox NAME=\"checkd[$i]\" VALUE=\"Sel[$i]\">$Data[$i]<br>"; }
}
?>
<br><INPUT TYPE=SUBMIT NAME="fButton" VALUE="Delete" </FORM>
</body></html>




Reply With Quote