Passing value via ahref

I had gone through some of similar post but I wonder why my code is not working evenif it seems okay.

<?php
					while($rs=mysql_fetch_array( $results))
					{	
				?>
                    <tr> 
                      <td colspan="2" height="4"></td>
                    </tr>
                    <tr> 
                      <td width="10%"><div align="center"><img src="_pics/arrow.gif" width="10" height="7"></div></td>
	  <?php
		//test:'
		$pro_id= $rs['cat_id'];
		echo $pro_id;
												 
	 ?>
                      
<td width="90%"> <a href="products.php?pro_id=<?=$pro_id ?>" class="mainItemsLinks" "> 
                        <?php
		
		 echo($rs['cat_name']);
		?>
                        </a> 
</td>
                    </tr>
                    <tr> 
                      <td colspan="2" height="1" bgcolor="#666666"></td>
                    </tr>
                    <?php 
						}
				?&gt;

Here I am trying to pass the value of “pro_id” to another page called “products.php”. But I wonder it is not passing any value at all. In the url it shows like …products.php?pro_id=<?=$pro_id ?> and no value is caught via get method ( $pro=$_GET[‘pro_id’]:wink: in products.php :frowning:

Can anyone help me in solving this?

it seems that you are using short tags:

<?=$pro_id ?>

it could be that your apache server / host is not configured for this or i snot allowing this.

try using the full version:

<?php echo $pro_id; ?>

you are also having an extra " in your href:


<a href="products.php?pro_id=<?=$pro_id ?>" class="mainItemsLinks" "> 


<a href="products.php?pro_id=<?php echo $pro_id; ?>" class="mainItemsLinks">