Php two forms one page -
i have deleteimage.php page @ top has includes 'functions.php' <== has functions
okk , in deleteimage.php page have form looks this:
<form action="#" method="post" id="delform"> <input type="submit" name="deleteimg" id="deleteimg" value="delete image"/> </form>
then in include page have function has:
foreach ($lines $line) { $images = explode(":", $line); if ($user == $images[2]) { $imgpath = $images[0]; $content .= '<div class="private"> <img class="yourgal" src="'; $content .= $imgpath . '"'; $content .= 'width="200" alt="$title" /><form action="#" method="post"><input type="checkbox" name="delete[]" value="'.$imgpath .'"/>delete</form></div>'; } } return $content;
which shows pictures uploaded checkbox beside it. have first form there can check many pictures , click delete delete them. heres problem, can't call $_post['delete], have function check
if (isset($_post['deleteimg'])) { echo 'you have selected ' . count($_post['delete']) . ' images'; }
but says undefined index: delete @ count($_post['delete']) ??????
should like:
$content = '<form action="#" method="post" id="delform">'; foreach ($lines $line) { $images = explode(":", $line); if ($user == $images[2]) { $imgpath = $images[0]; $content .= '<div class="private"> <img class="yourgal" src="'; $content .= $imgpath . '"'; $content .= 'width="200" alt="$title" /><input type="checkbox" name="delete[]" value="'.$imgpath .'"/>delete</div>'; } } content .= '<input type="submit" /></form>'; return $content;
Comments
Post a Comment