开发者

Have an extra /directory/ in the results of a dynamic link on php page

开发者 https://www.devze.com 2023-01-09 16:58 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消