จะ ทำ popup ยืนยันการลบข้อมูล <img src="http://images.torrentmove.com/id/ykxdd.jpg"> ตามรูป กดล
ตามรูป กดลบแล้ว ลบเลย อยากให้มี popup ยืนยันก่อนตะเขียน code อย่างไรครับ
code ที่ใช้อยู่
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "../index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?
$dsn_name = "TOT";
$username ="";
$password ="";
$connect= odbc_connect($dsn_name, $username, $password) or die("ติดต่อ DSN ไม่ได้");
$sql = "select * from R_PLK2";
$execute = odbc_exec($connect, $sql) or die ("เอ็กซิคิวส์คำสั่งไม่ได้");
?>
<style type="text/css">
<!--
.style1 {
font-family: AngsanaUPC;
font-size: 36px;
font-weight: bold;
}
.style2 {font-family: AngsanaUPC; font-size: 24px; font-weight: bold; }
-->
</style>
<title>แสดงข้อมูล Routing_E1_PLK2</title><p align="center"><img src="../images/tot_home_color_01.gif" width="800" height="60" /></p>
<p align="center" class="style1">แสดงข้อมูล Routing_E1_PLK2 </p>
<p align="center" class="style1"><span class="style2"><a href="Add_R_PLK2.php">Add</a> <a href="Search_R_PLK2.php">Search</a> <a href="Routing E1.php">Back</a></span></p>
<table width="130%" border="1">
<tr>
<td width="1%">
<div align="center">id</div>
</td>
<td width="3%">
<div align="center">ชุมสาย</div>
</td>
<td width="3%">
<div align="center">Route_(I/O)</div>
</td>
<td width="3%">
<div align="center">Number_of_Devices</div>
</td>
<td width="3%">
<div align="center">E1</div>
</td>
<td width="3%">
<div align="center">Type</div>
</td>
<td width="3%">
<div align="center">Signaling_Link</div>
</td>
<td width="3%">
<div align="center">Note</div>
</td>
<td width="1%">
<div align="center">แก้ไข</div>
</td>
<td width="1%">
<div align="center">ลบ</div>
</td>
</tr>
</table>
<?
$i=1;
while(odbc_fetch_row($execute,$i))
{
$id=odbc_result($execute,"id");
$ชุมสาย=odbc_result($execute,"ชุมสาย");
$Route_I_O=odbc_result($execute,"Route_I_O");
$Number_of_Devices=odbc_result($execute,"Number_of_Devices");
$E1=odbc_result($execute,"E1");
$Type=odbc_result($execute,"Type");
$Signaling_Link=odbc_result($execute,"Signaling_Link");
$Note=odbc_result($execute,"Note");
?>
<table width="130%" border="1">
<tr>
<td width="1%">
<div align="center">
<? echo "$id"; ?>
</td>
<td width="3%">
<div align="center">
<? echo "$ชุมสาย"; ?>
</td>
<td width="3%">
<div align="center">
<? echo "$Route_I_O"; ?>
</td>
<td width="3%">
<div align="center">
<? echo "$Number_of_Devices"; ?>
</td>
<td width="3%">
<div align="center">
<? echo "$E1"; ?>
</td>
<td width="3%">
<div align="center">
<? echo "$Type"; ?>
</td>
<td width="3%">
<div align="center">
<? echo "$Signaling_Link"; ?>
</td>
<td width="3%">
<div align="center">
<? echo "$Note"; ?>
</td>
<td width="1%">
<div align="center"><a href="Update_R_PLK2.php?id=<?=$id;?>">แก้ไข</a></div>
</td>
<td width="1%">
<div align="center"><a href="Fm_Del_R_PLK2.php?id=<?=$id;?>">ลบ</a></div>
</td>
</tr>
</table>
<?
$i++;
}
?>
<?
odbc_close($connect);
?>
Tag : - - - -
Date :
16 พ.ค. 2551 01:46:19
By :
mamme
View :
3215
Reply :
4
แก้รูป
Date :
16 พ.ค. 2551 01:48:07
By :
mamme
<?
$dsn_name = "TOT";
$username ="";
$password ="";
$connect= odbc_connect($dsn_name, $username, $password) or die("ติดต่อ DSN ไม่ได้");
$sql = "delete from R_PLK2 where [id]=$id";
$execute = odbc_exec($connect, $sql) or die ("เอ็กซิคิวส์คำสั่งไม่ได้");
odbc_close($connect);
?>
code ตัวกระทำการลบครับ
Date :
16 พ.ค. 2551 01:50:20
By :
เทพ
<script language="Javascript">
<!--
function Conf(object) {
if (confirm("ยืนยันต้องการลบ? \nDo u want to delete?") == true) {
return true;
}
return false;
}
//-->
</script>
<a href="Fm_Del_R_PLK2.php?id=<?=$id;?>" onClick='return Conf(this)');">>ลบ</a>
แบบนี้เปล่า
Date :
16 พ.ค. 2551 03:05:47
By :
deawx
แทรก ตรงส่วนไหนครับ
Date :
17 พ.ค. 2551 20:07:47
By :
mamme
Load balance : Server 03