PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Dec 14, 2017 8:11 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sat Jan 07, 2012 8:04 am 
Offline
Forum Newbie

Joined: Fri Dec 23, 2011 1:00 am
Posts: 9
hi i have a php code that deleting notification in the database i use this function
Syntax: [ Download ] [ Hide ]
jQuery(function ($) {
        $('#confirm-dialog input.confirm, #confirm-dialog a.confirm').click(function (e) {
                e.preventDefault();

                // example of calling the confirm function
                // you must use a callback function to perform the "yes" action
                confirm("Are you sure you want to delete this notification?", function () {
                        window.location.href = $("a.confirm").attr("href");
                });
        });
});

function confirm(message, callback) {
        $('#confirm').modal({
                closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
                position: ["20%",],
                overlayId: 'confirm-overlay',
                containerId: 'confirm-container',
                onShow: function (dialog) {
                        var modal = this;

                        $('.message', dialog.data[0]).append(message);

                        // if the user clicks "yes"
                        $('.yes', dialog.data[0]).click(function () {
                                // call the callback
                                if ($.isFunction(callback)) {
                                        callback.apply();
                                }
                                // close the dialog
                                modal.close(); // or $.modal.close();
                        });
                }
        });
}
 


and here's my code for viewing the records in the database

Syntax: [ Download ] [ Hide ]
<?php session_start();
               include('../Connection/mysql_connect_notification.php');
               
               $query="SELECT * FROM tb_notification WHERE Employee_No = '$_SESSION[u_name]' ORDER BY ID_No DESC";
               $result=mysql_query($query);
               
               while($row=mysql_fetch_array($result)) {
                    echo "<b>$row[3] $row[4]</b> <br/> $row[2]<br/>
                    <div id='content' style='background-color: white;'>
                    <div id='confirm-dialog'>
                    <a class='confirm' style='margin-left: 145px;' href='?delete=$row[0]' id='<?php echo $row[0]'>Delete</a><hr>"
;    
                    echo "</div>";
               }
?>
 


the question is i want to get the value of the link that i click and output it to the url using the $_GET.. the problem is i always get the last value.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], JSubira and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group