cannot display data?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
teckyan888
Forum Commoner
Posts: 40
Joined: Tue May 11, 2004 10:46 am

cannot display data?

Post by teckyan888 »

Code: Select all

<?php
<a href="product.php?CategoryID=<?php echo $row["CategoryID"];?>?UserName= <?php {$_GET["UserName"]}; ?> ">Select Product</a>
					
?>
How come i cannot get the UserName from the previous page?Any error in my statement?
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

To show the CategoryID you do echo $row['CategoryID'], but for the UserName you just do $_GET['UserName'] , ie in the first one you echo, in the second you don't, so try echo $_GET['UserName']
teckyan888
Forum Commoner
Posts: 40
Joined: Tue May 11, 2004 10:46 am

Post by teckyan888 »

Thanks your help...It can work...But when i link to other page,it cannot display again...

Code: Select all

<?php
	<a href="style.php?ProductID=<?php echo $row["ProductID"];?>?UserName=<?php echo $_GET["UserName"]; ?> ">Select Style</a>

?>
So,got any solution is better to get the UserName from page to page?
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Change ?UserName to &UserName
teckyan888
Forum Commoner
Posts: 40
Joined: Tue May 11, 2004 10:46 am

Post by teckyan888 »

It works already...Thanks mark999....
Post Reply