String concatenation and query string from link
Posted: Fri Nov 21, 2008 8:06 am
Hello,
I am building a online store with PHP and MYSQL. I have a navigation bar that in PHP, spits out categories in a link and my goal is, when a user clicks the link, that the correct items will be displayed on the target page.
I'm having trouble with proper concatenation though.
I don't have my code with me, but what I'm basically entering is... echo " "<li>" . "<a href=" . $row["category"] . " ">" . "</a>" . "</li>" " ;
I'm not sure what I'm doing wrong, I've been playing with this forever, I've had funny things happen where I don't even close off the href tag and it still appears as a link. Can someone tell me the proper way to code this?
Also, I want this category to get passed into a query string, so when the user clicks the link for cat X, all items in X will appear. I'm used to using.net where on page load I can call the Sqldatasource and write teh select statement. How is this achieved in php...
Thank you.
I am building a online store with PHP and MYSQL. I have a navigation bar that in PHP, spits out categories in a link and my goal is, when a user clicks the link, that the correct items will be displayed on the target page.
I'm having trouble with proper concatenation though.
I don't have my code with me, but what I'm basically entering is... echo " "<li>" . "<a href=" . $row["category"] . " ">" . "</a>" . "</li>" " ;
I'm not sure what I'm doing wrong, I've been playing with this forever, I've had funny things happen where I don't even close off the href tag and it still appears as a link. Can someone tell me the proper way to code this?
Also, I want this category to get passed into a query string, so when the user clicks the link for cat X, all items in X will appear. I'm used to using.net where on page load I can call the Sqldatasource and write teh select statement. How is this achieved in php...
Thank you.