Problem with Links

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
eggoz
Forum Commoner
Posts: 43
Joined: Fri Dec 27, 2002 8:51 pm

Problem with Links

Post by eggoz »

I have been working on passing values to paypal, and I am stuck. Almost all the links work. Just having problems when I have a link like this one. (click on BUY NOW). And here is my script right now.

Code: Select all

<?php 
$Description = urlencode($a_result&#1111;'Description']); 
$Code = urlencode($a_result&#1111;'Code']);
$Price = urlencode($a_result&#1111;'Price']);
$Count = urlencode($a_result&#1111;'Count']);
$Manufacturer = urlencode($a_result&#1111;'Manufacturer']);
?> 

<a href="https://www.paypal.com/cart/add=1&business=information@aardvarksafety.com&item_name=<? echo $Description; ?>&item_number=<? echo $Code; ?>&amount=<? echo $Price; ?>" target="_blank" class="nolink">Buy Now</a>

I was told to use urlencode, and I see its working, but I still have problems as you can see. Any ideas?
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

There is nothing wrong with your PHP code. Are you sure that paypal's link is working?
Jaymz
Forum Newbie
Posts: 3
Joined: Sun Feb 16, 2003 7:56 am
Contact:

Post by Jaymz »

try to use rawurlencode instead urlencode
eggoz
Forum Commoner
Posts: 43
Joined: Fri Dec 27, 2002 8:51 pm

Hmmm.

Post by eggoz »

Yes, I am sure that Paypal's links are working. It works on all products, except those with a / or () in the links. There appears to be no problems with " anymore. Anything inside the () don't show up in paypal. I thought the urlencode was suppose to fix this? Grrr. Fustrating.
eggoz
Forum Commoner
Posts: 43
Joined: Fri Dec 27, 2002 8:51 pm

Dumb Mistake.

Post by eggoz »

Dumb Mistake... the () do work. Forgot to change to urlencode. So it's just down to the /. Any ideas?
Post Reply