I loop through an xml and give my user a checkbox to click to delete...the form is sent back to itself for processing.
// list all entries to delete in main body of document
$file = '../sidebar.xml';
$xml = simplexml_load_file($file);
foreach($xml->children() as $myquote)
{
echo"<hr>
<input type=\"hidden\" name=\"dcount\" id=\"dcount\" value=".$myquote->id." />
Quote: ".$myquote->thequote."<br />
Reference: ".$myquote->reference."<br />
<input type=\"checkbox\" name=".$myquote->id." id=".$myquote->id." /> Delete Item";
}
//script for when the page loads...to delet item
//I'm testing and am just wanting to print the name (dcount) of items checked
$dcount = $_POST["dcount"];
$dfile = '../sidebar.xml';
$dxml = simplexml_load_file($dfile);
foreach($dxml->children() as $dmyquote)
{
if($dcount=='checked')
{
echo $dcount."<br />";
}
}
The page works. I can clice one or many checkboxes but when I submit, I don't get any echo. What am I doing wrong?
I'm starting to feel like a complete idoit when php is concerned...but I'm just learning.



Reply With Quote



Bookmarks