yes,i agree with you,Richard L. Buskirk. process by client-side script,such as javascript is the best and convenient way. Best regards, Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**) 2011/4/29 <admin@xxxxxxxxxxxxxxxxxxx>: > This can be done in the delete.php file OR use javascript onClick to confirm > the intent. > > > Delete.php > <?php > If($_GET['confirm'] == "Yes") > { > Â Â Â Â//Delete actions > }else If($_GET['confirm'] == "No") > { > Â Â Â Â//No Delete actions. > }else{ > //display a delete confirmation and remember to carry required information > like the value you passed for delete. > } > ?> > > > Personally I would use the javascript page navigation is senseless if they > miss click. > > Javascript: Small and simple javascript. > > onclick="return confirm('Are you sure you want to delete?')" > > > > Richard L. Buskirk > > > -----Original Message----- > From: Chris Stinemetz [mailto:chrisstinemetz@xxxxxxxxx] > Sent: Friday, April 29, 2011 12:33 AM > To: php-general@xxxxxxxxxxxxx > Subject: PHP delete confirmation > > I have been trying to figure out how to add delete confirmation for > the bellow snippet of code. I would prefer not to use javascript. Can > anyone offer any advise on how to right the delete confirmation in > PHP? > > Thank you in advance. > > P.S. I apologize for the indention. For some reason gmail messes it up. > > <?php > Â Â Â // loop through results of database query, displaying them in the > table > Â Â Â while($row = mysql_fetch_array( $result )) { > > Â Â Â Â Â Â Â Â// echo out the contents of each row into a table > Â Â Â Â Â Â Â Â Â echo "<tr>"; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['Name'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['Date'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['StoreInfo'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['Address'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['Type'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['EngTech'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['StoreManager'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['BBtime'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['BBup'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['BBdown'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['SiteSect'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['VoiceCall'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td>' . $row['Comments'] . '</td>'; > Â Â Â Â Â Â Â Â Â echo '<td><a href="edit.php?id=' . $row['id'] > .'">Edit</a></td>'; > Â Â Â Â Â Â Â Â Â echo '<td><a href="delete.php?id=' . $row['id'] > .'">Delete</a></td>'; > Â Â Â Â Â Â Â Â Â echo "</tr>"; > Â Â Â } > > Â Â Â // close table> > Â Â Â echo "</table>"; > ?> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php