PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
It is currently Sat Dec 15, 2018 10:08 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 
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) {

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


                        // if the user clicks "yes"
                        $('.yes',[0]).click(function () {
                                // call the callback
                                if ($.isFunction(callback)) {
                                // 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();
               $query="SELECT * FROM tb_notification WHERE Employee_No = '$_SESSION[u_name]' ORDER BY ID_No DESC";
               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.

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: No registered users and 8 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