View Single Post
  #2 (permalink)  
Old 09-13-10, 03:15 PM
jsNewbie jsNewbie is offline
New Member
 
Join Date: Sep 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Golith,

Do you need to accomplish this without a page reload? If not, why not just use php to execute like below?

I have edited only the form part of your code below:
// check if active or not then place right icon
echo " <form name=form method=post action=[filename].php>\n";
echo "<td align=center>" ?> <img src="http://www.hotscripts.com/forums/images/green_tick.png" width="30" height="30"><img src="http://www.hotscripts.com/forums/images/red_cross.jpg" width="30" height="30"> <?php "</td>";
echo "<td><input type = submit name = update value = update></td>";
echo "<td> <form><input type = submit name = del_file value = del_file ></td>";
echo "<td><input type = submit name = del_row value = del_row ></td>";
echo "</tr>";
echo "</form>\n";

Then, above the opening html tag:

if(!empty($_POST[update])) {
//perform relevant update
}

if(!empty($_POST[del_file])) {
//delete file from server
}

if(!empty($_POST[del_row])) {
//delete the row from the database
}

Good luck!
Reply With Quote