Not transfering data

Can anyone help with this…

Hi i have a query that must pass the ticketno to the same page…via href…
This is the query that i just made.



  $selectTicketsQuery = mssql_query("Select * from tblTicket inner join tblAssign on tblTicket.TickNo=tblAssign.TicketNo where tblTicket.Status='Open'");
    while($pendticket = mssql_fetch_array($selectTicketsQuery)){
        $pendtickets[] = $pendticket;
    }


<?php   foreach($pendtickets as $pendticket){ ?>
						<tr>
							<td><?php echo $pendticket['TicketNo']; ?></td>
							<td><?php echo $pendticket['UserName']; ?></td>
							<td><?php echo $pendticket['DateCreate']; ?></td>
							<td><?php echo $pendticket['TimeCreate']; ?></td>
							<td><?php echo $pendticket['Category']." (".$pended['Subcat'].")"; ?></td>
							<td><?php echo $pendticket['AssignTo']; ?></td>
							<td><?php echo "<div style='text-align:center;'><a href='#idno={$pendticket['TicketNo']}' class='lnchPopop' style='border:1px solid #dadada; background:#fff;  padding:3px 3px; color:gray; text-decoration:none; '>Grab Ticket</a></div>"?></td>
											
						</tr>
					<?php } ?>

It must get the value via href.


<body>
<?php echo $id=$_GET['idno'];?>
</body>


Am i doing it wrong…
Please Help…Thx…

Yes, you’re doing it wrong.
#idno={$pendticket[‘TicketNo’]}
comes out as #idno=1

means you’re looking for a bookmark on the same page, not reloading the page.

I think you probably meant <a href=‘somefilenamehere.php?idno={$pendticket[‘TicketNo’]’>

Thanks for the reply…

the code <a href=‘#’ class=‘lnchPopop’></a> is a jquery where a popup box will appear…

i will post my whole code for better understanding.



<?php
session_start();
include_once("conn.php");
if(isset($_SESSION['username'])){

  $pendtickets = array();
if(mssql_num_rows(mssql_query("Select * from tblTicket
inner join tblAssign
on tblTicket.TickNo=tblAssign.TicketNo where tblTicket.Status='Open'"))>0)
{

     $selectTicketsQuery = mssql_query("Select * from tblTicket inner join tblAssign on tblTicket.TickNo=tblAssign.TicketNo where tblTicket.Status='Open'");
    while($pendticket = mssql_fetch_array($selectTicketsQuery)){
        $pendtickets[] = $pendticket;
    }

?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<link href="css/mystyle.css" rel="stylesheet" type="text/css"/>
		<link rel="stylesheet" href="css/table sorter.css" type="text/css" media="print, projection, screen">
		<script type="text/javascript" src="jquery/jquery-1.2.6.min.js"></script>
		<script type="text/javascript" src="jquery/jquery.tablesorter.js"></script> 
		<script type="text/javascript" src="jquery/jquery.quicksearch.js"></script>
		<script type="text/javascript" src="jquery/tablesort.js"></script>  
	
		<style type="text/css">    
			div.quicksearch 
			{              
			  padding-bottom: 10px;      
			}
		</style>
	<script  type="text/javascript" language="javascript">
	

	$(document).ready(function(){
			$(".QTPopup").css('display','none')

//alert("ahi");
		$(".lnchPopop").click(function(){
			$(".QTPopup").animate({width: 'show'}, 'slow');
			})
		$(".closeBtn").click(function(){
			
			$(".QTPopup").css('display', 'none');
			})
		

})
							   

	
</script>
<style>
/* reset styles  */
body, html,div, span, applet, object, iframe,
 h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	font-size: 100%;
}
input, select, textarea {
	font-family:Arial, Helvetica, sans-serif;	
	font-size:12px;
	padding:2px 0;
}
body {
	line-height: 1;
	font-family:Arial, Helvetica, sans-serif;
	background:#f8f5ec;

}

ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}

/* remember to define focus styles! */
:focus {
	outline: 0;
	-moz-outline: none;


}

/* remember to highlight inserts somehow! */
ins {
	text-decoration: none;
}
del {
	text-decoration: line-through;
}

/* tables still need 'cellspacing="0"' in the markup */
table {
	border-collapse: collapse;
	border-spacing: 0;
}
/* reset styles ended */

body {
        margin:0;
        padding:0;
        font: bold 12px/1.5em Arial;
}




/* text box  starts here */
	
#content .titlebarLeftc, .titlebarLeftc{
 	background:url('img/title_bar_leftc.gif') no-repeat;
	height:28px;
 }
 #content .titlebarRightc, .titlebarRightc{
	background:url(img/title_bar_rightc.gif) no-repeat right top;
	height:28px;
}
 #content .titlebar, .titlebar{
	background:url('img/title_bar_bg.gif') repeat-x left top;
	height:28px;
	margin:0 8px;
}
/* text box  end here */


/* input buttons  starts here */
.ybtn_s { 
				background:url(img/ybtn_small.png) no-repeat ;
				width:69px;
				height:20px;
				border:0px ;
				font-weight:bold ;
				color:#3b3f41;
				font-size:11px;
				
				
			  }

.gbtn_s { 
				background:url(img/gbtn_small.png) no-repeat;
				width:69px;
				height:20px;
				border:0px ;
				font-weight:bold;
				color:#3b3f41;
				font-size:11px;
			  }
.gbtn_s:active { 
				background:url(img/gbtn_small_active.png) no-repeat;
			  }
	.popupGrayBg {
		position:fixed;
		width:100%;
		height:100%;
		background:black;
		z-index:1001;
		left:0;
		top:0;
		opacity:.5;
		filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
		}
	.QTPopupCntnr {
		width:487px;
		position:fixed;
		z-index:1200;
		background:gray;
		left:50%;
		top:50%;
		margin-left:-244px;
		margin-top:-276px;
		}
	.gpBdrLeftTop {
		width:6px;
		height:6px;
		background:url(img/greenPopupBdr.png) left top no-repeat;
		float:left;
		}
	.gpBdrRightTop {
		width:6px;
		height:6px;
		background:url(img/greenPopupBdr.png) right top no-repeat;
		float:right;
		}
	.gpBdrTop {
		height:3px;
		background:#a9b6e1;
		border-top:3px solid #3b4f91;
		margin-left:6px;
		margin-right:6px;
		}
	.gpBdrLeft {
		border-left:3px solid #3b4f91;
		background:#fff;
		}
	.gpBdrRight {
		border-right:3px solid #3b4f91;
		background:#fff;
		min-height:400px;
		position:relative;
	}
	.gpBdrLeftBottom {
		width:6px;
		height:6px;
		background:url(img/greenPopupBdr.png) left bottom no-repeat;
		float:left;
		}
	.gpBdrRightBottom {
		width:6px;
		height:6px;
		background:url(img/greenPopupBdr.png) right bottom no-repeat;
		float:right;
		}
	.gpBdrBottom {
		height:3px;
		background:#fff;
		border-bottom:3px solid #3b4f91;
		margin-left:6px;
		margin-right:6px;
		}
	.gpBdrRight .caption {
		background:#a9b6e1;
		line-height:38px;
		padding-left:10px;
		font-family:Arial, Helvetica, sans-serif;
		font-size:15px;
		font-weight:bold;
		color:#3b4f91;
		}
	.gpBdrRight .closeBtn {
		background:red;
		width:31px;
		height:31px;
		position:absolute;
		right:-15px;
		top:-15px;
		background:url(img/grn_pp_cls_btn_normal.png) no-repeat;

		}
	.gpBdrRight .closeBtn:hover {
		background:url(img/grn_pp_cls_btn_over.png) no-repeat;
		}

	.gpBdrRight .content {
		padding:25px;
		font-weight:normal;
		}

</style>

	</head>
		
	<body>	

<center>


	<br/>
	<h1 size='15px' align='left'>Pending Ticket</h1>
	
		<table id="tableOne" class="yui">
			<thead>
				<tr>
					<th><a href='#'>Ticket No.</a></th>
					<th><a href='#'>Create By</a></th>
					<th><a href='#'>Create Date</a></th>
					<th><a href='#'>Create Time</a></th>
					<th><a href='#'>Problem Description</a></th>
					<th><a href='#'>Assign To</a></th>
					
				</tr>
			</thead>
			<tbody>			
					<?php   foreach($pendtickets as $pendticket){ ?>
						<tr>
							<td><?php echo $pendticket['TicketNo']; ?></td>
							<td><?php echo $pendticket['UserName']; ?></td>
							<td><?php echo $pendticket['DateCreate']; ?></td>
							<td><?php echo $pendticket['TimeCreate']; ?></td>
							<td><?php echo $pendticket['Category']." (".$pended['Subcat'].")"; ?></td>
							<td><?php echo $pendticket['AssignTo']; ?></td>
							<td><?php echo "<div style='text-align:center;'><a href='#?idno={$pendticket['TicketNo']}' class='lnchPopop' style='border:1px solid #dadada; background:#fff;  padding:3px 3px; color:gray; text-decoration:none; '>Grab Ticket</a></div>"?></td>
											
						</tr>
					<?php } ?>
			</tbody>
				<tfoot align='left'>
					<tr style="display:none;">
						<td colspan="6">No rows match the filter...</td>
				</tr>	    
			</tfoot>			
		</table>

	
<form method='post'>
		
    <div class="QTPopup">
    	<div class="popupGrayBg"></div>
    	<div class="QTPopupCntnr">

        	<div class="gpBdrLeftTop"></div>
            <div class="gpBdrRightTop"></div>
            <div class="gpBdrTop"></div>
            <div class="gpBdrLeft">
            	<div class="gpBdrRight">
                	<div class="caption">
					<?php echo $id=$_GET[idno]; ?>
                    	
                    </div>
					
                    <a href="#" class="closeBtn" title="Close"></a>

                    
                    <div class="content">
                    	<table align='left' cellpadding="0" cellspacing="0">
                        	<tr align='left'>
                            	<td>Name</td>
                            	<td ><?php echo "Grab this".$id; ?>
                                    <div class="titlebarLeftc">
                                    <div class="titlebarRightc">
                                    <div class="titlebar" ><input type="text" value=""  style="border:0px;  background:none; margin-top:5px;"/>

                                    </div>
                                    </div>
                                    </div> 
                                </td>
                            </tr>
                            <tr>
                            	<td colspan="2">&nbsp;</td>
                            </tr>
                        	<tr>

                            	<td align='left'>Email</td>
                            	<td width="260">
                                    <div class="titlebarLeftc">
                                    <div class="titlebarRightc">
                                    <div class="titlebar" style="width:250px;"><input type="text" value=""  style="border:0px;  background:none; margin-top:5px; width:245px;"/>
                                    </div>
                                    </div>
                                    </div> 
                                </td>

                            </tr>
							<tr>
                            	<td colspan="2">&nbsp;</td>
                            </tr>
							<tr>

                            	<td align='left'>Email</td>
                            	<td width="260">
                                    <div class="titlebarLeftc">
                                    <div class="titlebarRightc">
                                    <div class="titlebar" style="width:250px;"><input type="text" value=""  style="border:0px;  background:none; margin-top:5px; width:245px;"/>
                                    </div>
                                    </div>
                                    </div> 
                                </td>

                            </tr>
                     
                      </table> 
                     <table>
                            <tr>
                            	<td>&nbsp;</td>
                            </tr>
                        	<tr align='left'>
                            	<td>
                                	Subject
                                </td>
								<td width="260">
                                    <div class="titlebarLeftc">
                                    <div class="titlebarRightc">
                                    <div class="titlebar" style="width:250px;"><input type="text" value=""  style="border:0px;  background:none; margin-top:5px; width:245px;"/>
                                    </div>
                                    </div>
                                    </div> 
                                </td>
                            </tr>
                            <tr>
                            	<td>&nbsp;</td>
                            </tr>
                        	<tr>

                            	<td>
                                	Message
                                </td>
                            </tr>
                             <tr>
                            	<td style="height:5px;"></td>
                            </tr>

                            <tr>
                            	<td>

									<textarea class="textareagradiant" style="width:428px; height:116px; border:1px solid #CFCECE;"> </textarea> 

                                </td>
                            
                            </tr>
                            <tr>
	                            <td style="height:5px;"></td>
                            </tr>
                            <tr>
	                            <td style="height:10px;"></td>
                            </tr>

                            <tr>
                            	<td>
                                <input type="button" value="Submit" class="gbtn_s"  />
                                <input type="button" value="Reset" class="gbtn_s"  />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>

            </div>
            <div class="gpBdrLeftBottom"></div>
            <div class="gpBdrRightBottom"></div>
            <div class="gpBdrBottom"></div>
    </div>
    </div>	
</center>	
</form>
	</body>
	<?php
}else{
echo "<h1 align='center'><font color='#ff0000'>No Pending Ticket</font><h1>";}
?>
	</html>
<?php
	
}else{ //not logged in
    header('location: login.php');
}
?>


I’m gonna preface this by saying i’m NOT a jQuery coder.

But it seems to me you’re mixing your client-time and server-time stuff up.

Let me ask this;
When a user clicks on the link, do you want the page to reload, or not?

Yup…and get the ticketno…in the link…

If you want it to reload, then we’ll stay here in the PHP forum. (If you’d said no, I’d have shipped you off to the Javascript one with a tag that read “Property of AJAX”)

change the link to <a href=“?idnum={$pendticket[‘TicketNo’]}”> (note: no jQuery class definition here!)


            $(".QTPopup").css('display','none')

Well now we want that to be conditional…


            $(".QTPopup").css('display','<?php echo isset($_GET['idnum'] ? 'block' : 'none' ; ?>')

seems not working…

‘not working’ tells me all of nothing…

Does the page reload when you click the link? Do you see the idnum on the URL line? When you open the Source of that page, does it show QTPopup set to display block or none?

yup i see the idnum in the url line…but on the popup box it does not display the idnum…

Okay so we can see the parameter on the URL, thats good.
We can see the popup box. Also good.


<?php echo $id=$_GET[idno]; ?>

You’re missing quotes around your field name. $_GET[‘idno’]. PHP has no idea what idno (without quotes) is.

when i use what you suggested i does some error


 $(".QTPopup").css('display','<?php echo isset($_GET['idnum'] ?, 'block' : 'none' ; ?>')


Parse error: syntax error, unexpected '?', expecting ',' or ')' 

so i try to change the code into and it seems working


$(".QTPopup").css('display','<?php echo isset($_GET['idnum']) ? 'block' : 'none' ; ?>')

and i try to use the echo out…the idnum does not display in popup box.

er yes. There should indeed have been a ) there.

Try splitting it into separate lines


<?php $id = $_GET['idno']; 
  echo $id;
?>

shouldnt be the problem, but it cant hurt…

still no luck…and when i click the submit button it does not link no the next page…i think there is a bug on the popup box…

So… when you click on the form button, you lose the variable on the URL? You’re running in IE, i assume. IE is the bane of the internet.


//Somewhere at the top...
if(isset($_POST['idno'])) { $_GET['idno'] = $_POST['idno']; }
//Down at your form...
<input type='hidden' name='idno' value='<?= $id ?>'>

Still the same…thanks for the help though…i think i will link with to other page…