Have an extra /directory/ in the results of a dynamic link on php page
Here I am again. I hate to be a bother but here's another zinger.
I have a custom made shopping cart and have some dynamic links in the page that when served up in a browser will replace $name with the product name and $p with the procuct id number. I'm aiming for a link on the page like this: http://www.something.com/buy/ProductName/382793/
What I'm getting开发者_如何学运维 is http://www.something.com/buy/ProductName/0/382793
and no trailing slash. Gotta have the slash.
The code looks like this: <a title=\"View Product.\" href=\"http://www.something.com/buy/$name/$p/". $line["PID"]. "\">PRODUCT LINKO</a>
You can see that I have $name and $p separated by a slash and a trailing slash at the end but it's not working. Any ideas ladies and gentlemen?
The "tailing" slash at the end is escaping the double quote:
<a title=\"View Product.\" href=\"http://www.something.com/buy/$name/$p/". $line["PID"]. "/\">PRODUCT LINKO</a>
Should add the tailing slash as requested.
精彩评论