How to set deletion prompt in php: 1. In link form, the code is [echo "6b82627f32af8b21acfac58cae6c19f9delete5db79b134e9f6b82c0b36e0489ee08ed;】; 2. Button form, the code is [
##php How to set the deletion prompt:
1. Link format
echo "<a href = "delete2.php?id=$id">删除</a>;
Just change this line. echo "<a href = "delete2.php?id=$id" onclick="if(confirm('确实要删除此条记录吗?') " >删除</a>;
Add to the link An onclick event occurred.
2. Button form
<button onclick="if(confirm('确实要删除此条记录吗?'))
return submit();
else return false;
" class="button_a" style="width:95;height:22" ;><img src="images/icon_21x21_del.gif" align="absmiddle" />删除</button>
3. Button link form
<button onClick="if(confirm('确实要删除此条记录吗?')) return location.href='delete2.php?phoneid=$phoneid';else return false;" class="button_a" style="width:50;height:22" ;>
<img src="images/icon_del.gif" align="absmiddle">删除</button>
4 , input button method
<input class="button_a" onclick="if(confirm('确实要删除此条记录吗?')) return submit();
else return false;" type="submit" name="Submit" value="删除" >
Related learning recommendations:PHP programming from entry to proficiency
The above is the detailed content of How to set deletion prompt in php?. For more information, please follow other related articles on the PHP Chinese website!