Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Problems with my Shopping Cart Nav Bar Direct

Hey Guys,

So i am trying to finish up my simple php application.

I have added the link to my carts anchor tagso that when a user clicks on the shopping cart it will direct them (in a new box)to their cart.

now when i click on this link ( clicking on cart), i get a paypal error message stating the following:

Error Detected

Error Message PayPal cannot process this transaction because of a problem with the seller's website. Please contact the seller directly to resolve this problem.

PayPal cannot process this transaction because of a problem with the seller's website. Please contact the seller directly to resolve this problem.

Now this is a problem, since i think this would be the last thing i would want a customer to see. i thought maybe it was a problem with the code i provided:

<li class="right"><a target="paypal" href="https://www.paypal.com/cgi-bin/webscr?        cmd=_cart&amp;businesse=NDQXBZ3W29BDJ&amp;display=1">Cart</a></li>

the code is right to my knowledge, i thought maybe it was because someone had to actually have something in their cart to not view the error, only to see the same error.

any solutions ? much appreciated guys !

3 Answers

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

A couple of things look wrong at first glance:

  • I see the GET variable businesse (with an extra e at the end). Try removing that.
  • I see space between the ? and the cmd variable. Try removing that.

The web address should look like this (with your business ID in it):

https://www.paypal.com/cgi-bin/webscr?cmd=_cart&business=Q6NFNPFRBWR8S&display=1

Hey randy,

thanks again for the reply.

i did see the typo with the "e"

but the issue with the space in between the "?" and "cmd", when i look at the code in notepad++ the code is shown how you have input it. when i then load the screen it shows it as a space in the code.

thats my main issue at the moment. any suggestions ? i also have added &"amp"; im guessing that shouldnt be a problem, right ?

i also wanted to add that when i look at the url in browser bar, the link does not show a space in between ? and the cmd

EDIT: the deleting of the "e" was the issue, not sure why it would create a space in the url like it was doing.

Thanks Randy !, i really look forward to some more PHP to learn.

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

Glad you got it working! I think the space might have only shown up when you pasted it here in the forum. If the space was not showing up in the address bar, then it wasn't in the code.