php jquery passing value to another page
<p>i have this code that i am trying to solve since last night.
my problem is that when i pass the value on jQuery it only read the first form of value.
for example here are my codes.</p>

<p>I am going to select on my db, and work it with while so everything it will view all the info that the user needs.</p>

<p>if you saw the <code>getID</code> name of my input. i will pass the value of this id to jQuery.</p>

<pre><code>$checkTicket = mysql_query( "SELECT * FROM {$statement} LIMIT {$startpoint} , {$limit}" ) or die ( mysql_error() );
$i = 1;
while ( $rowCheck = mysql_fetch_array( $checkTicket ) ) {
$row_color = ($row_count % 2) ? $color1 : $color2;
    echo '
    &lt;tr&gt;
        &lt;td align="center" style="background-color:'.$row_color.'"&gt;
        &lt;input type="hidden" name="getID" value="'.$rowCheck['s_id'].'" /&gt;
        &lt;input type="hidden" name="getTic" value="'.$rowCheck['ticket_number'].'" /&gt;
        '.$i.'
        &lt;/td&gt;
        &lt;td align="center" style="background-color:'.$row_color.'"&gt;'.$rowCheck['ticket_number'].'&lt;/td&gt;
        &lt;td align="center" style="background-color:'.$row_color.'"&gt;'.$rowCheck['email'].'&lt;/td&gt;
         &lt;/tr&gt;';
}
</code></pre>

<p>my jquery code below.</p>

<pre><code>var getID = $( 'input[name=getID]' ).val();
var getT = $( 'input[name=getTic]' ).val();
$.ajax({
    type:"GET",
    url:"ticket.php",
    data: {q: getID, t: getT},
    dataType: 'html',
    target: '#ticket_section',
    success: function(data){
        $("#dialog").html(data);
    }
})
</code></pre>

<p>this jQuery will get the id and pass it to my ticket.php
the codes below are my ticket.php</p>

<pre><code>&lt;?php
$getTicket = $_GET['t'];
$sqlTicket = mysql_query( "SELECT * FROM jon_support_re WHERE ticket_number = '".$getTicket."' " ) or die ( mysql_error() );
while ( $row = mysql_fetch_array( $sqlTicket ) ) {
    $date = date( 'Y-M-d', strtotime( $row['date'] ) );
    echo '
    Ticket Code : '.$row['ticket_number'].'&lt;br /&gt;
    Submitted by : '.$row['uname'].'&lt;br /&gt;
    Submitted Date : '.$date.'&lt;br /&gt;
    Status : '.ucfirst( $row['status'] ).'&lt;br /&gt;
    Description : '.$row['re_subject'].'
    &lt;hr /&gt;
    ';
}
?&gt;
</code></pre>

<p>but when i click the selected number for example it i choose the user ticket <code>number 3</code> the echo will appear is just the value id number 1. i also used alert to know if it really get the other id number but the only id number it got was 1.</p>

<p>my i know what is wrong when i passing the value of id?</p>

<p><em><strong>UPDATE</em></strong></p>

<p>this is my whole jQuery
it call the modal so when the popup of modal im going to choose whos user need reply.
so when i click reply it will pass me the id. i need their id and ticket number to respond on their concern.</p>

<pre><code>$(document).ready(function() {  

    //select all the a tag with name equal to modal
    $('a[name=modal]').click(function(e) {
        //Cancel the link behavior
        e.preventDefault();
        //Get the A tag
        var id = $(this).attr('href');

        //Get the screen height and width
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();

        //Set height and width to mask to fill up the whole screen
        $('#mask').css({'width':maskWidth,'height':maskHeight});

        //transition effect     
        $('#mask').fadeIn(1000);    
        $('#mask').fadeTo("slow",0.8);  

        //Get the window height and width
        var winH = $(window).height();
        var winW = $(window).width();

        //Set the popup window to center
        $(id).css('top',  winH/2-$(id).height()/2);
        $(id).css('left', winW/2-$(id).width()/2);

        //transition effect
        $(id).fadeIn(500);

        var getID = $( 'input[name=getID]' ).val();
        var getT = $( 'input[name=getTic]' ).val();
        $.ajax({
            type:"GET",
            url:"ticket.php",
            data: {q: getID, t: getT},
            dataType: 'html',
            target: '#ticket_section',
            success: function(data){
                $("#dialog").html(data);
            }
        })

    }); 
});
</code></pre>

<p>this is my whole php form code.</p>

<p>so when i click the users id it will pass to my dialog the id and ticket number</p>

<pre><code>&lt;div id="boxes"&gt;
    &lt;div id="dialog" class="window"&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;h3&gt;Support&lt;/h3&gt;
&lt;hr /&gt;
&lt;div id="ticket_section"&gt;
&lt;form method="post"&gt;
&lt;table width="100%" style="padding:10px;" class="datatable"&gt;
    &lt;tr&gt;
        &lt;th&gt;#&lt;/th&gt;
        &lt;th&gt;ticket&lt;/th&gt;
        &lt;th&gt;email&lt;/th&gt;
        &lt;th&gt;status&lt;/th&gt;
        &lt;th&gt;option&lt;/th&gt;
    &lt;/tr&gt;
&lt;?php
$page = (int) (!isset($_GET["page"]) ? 1 : $_GET["page"]);
$limit = 10;
$startpoint = ($page * $limit) - $limit;
//to make pagination
$statement = "jon_support";

$color1 = "#F8F8F8"; 
$color2 = "#FFFFFF"; 
$row_count = 0;
$checkTicket = mysql_query( "SELECT * FROM {$statement} LIMIT {$startpoint} , {$limit}" ) or die ( mysql_error() );
$i = 1;
while ( $rowCheck = mysql_fetch_array( $checkTicket ) ) {
$row_color = ($row_count % 2) ? $color1 : $color2;
    echo '
    &lt;tr&gt;
        &lt;td align="center" style="background-color:'.$row_color.'"&gt;
        &lt;input type="hidden" name="getID'.$i.'" value="'.$rowCheck['s_id'].'" /&gt;
        &lt;input type="hidden" name="getTic" value="'.$rowCheck['ticket_number'].'" /&gt;
        '.$i.'
        &lt;/td&gt;
        &lt;td align="center" style="background-color:'.$row_color.'"&gt;'.$rowCheck['ticket_number'].'&lt;/td&gt;
        &lt;td align="center" style="background-color:'.$row_color.'"&gt;'.$rowCheck['email'].'&lt;/td&gt;
        &lt;td align="center" style="background-color:'.$row_color.'"&gt;&lt;strong&gt;'.ucfirst ( $rowCheck['status'] ).'&lt;/strong&gt;&lt;/td&gt;
        &lt;td align="center" style="background-color:'.$row_color.'"&gt;
        &lt;a href="?e=edit&amp;tid='.$rowCheck['s_id'].'" style="text-decoration:none;"&gt;
            &lt;img src="images/edit.png" alt="edit" width="19" /&gt;
        &lt;/a&gt;
        &lt;a href="#dialog" name="modal" style="text-decoration:none;"&gt;
            &lt;img src="images/pkg.png" alt="view" width="19" /&gt;
        &lt;/a&gt;
        &lt;a href="admin.php?p=support&amp;d=del&amp;tid='.$rowCheck['s_id'].'" style="text-decoration:none;"&gt;
            &lt;img src="images/delete_ticket.png" alt="delete" width="19" /&gt;
        &lt;/a&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    ';
$i++;
$row_count++;
}
?&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;hr /&gt;      
&lt;?php echo pagination($statement,$limit,$page); ?&gt;
&lt;/div&gt;
</code></pre>

<p>so if its popup the ticket.php will appear.
i hope i explain correctly.
thank you all sir.</p>
