Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pay pal return URL  problem

Posted on 2006-07-17
3
Medium Priority
?
268 Views
Last Modified: 2006-11-18
Hai,
I integerate shopping cart to paypal i give return url after payment both sucess and Cancel url with some GET variables but the variables are not reply in paypal how to i fix this?

I set Return URL with querystring like
<input type=\"hidden\" name=\"return\" value=\"$site_url/bala/thanks.php?total=$totp&cart_id=$cart_id&uid=$uid\" />

But i got return URL from paypal $site_url/bala/thanks.php?  only Query string's are missing How to retrive this ?

My code here
echo "<form id=\"form1\" name=\"upfrm\" method=\"post\" action=\"https://www.paypal.com/cgi-bin/webscr\">
                      <div align=\"center\">
                      <input type=\"hidden\" name=\"cmd\" value=\"_xclick\" />                        
            <input type=\"hidden\" name=\"business\" value=\"$pemail\" />                      
             <input type='hidden' name='item_name' value=\"Images in DNB PHOTOGRAPHY\" />
                        <input type=\"hidden\" name=\"cart_id\" value=\"$cart_id\" />
                        <input type=\"hidden\" name=\"amount\" value=\"$totp\" />
                        <input type=\"hidden\" name=\"first_name\" value=\"$name\" />
                        <input type=\"hidden\" name=\"currency_code\" value=\"USD\" />
                        <input type=\"hidden\" name=\"uid\" value=\"$uid \" />
                        <input type='hidden' name='cn' value='DNB PHOTOGRAPHY  payment gateway!' />
<input type=\"hidden\" name=\"return\" value=\"$site_url/bala/thanks.php?total=$totp&cart_id=$cart_id&uid=$uid\" />
                <input type=\"hidden\" name=\"cancel_return\" value=\"$site_url/bala/thanks.php?total=$totp&cart_id=$cart_id&uid=$uid&fail=fail\" />                        
                          <input name=\"Submit\" type=\"submit\" class=\"colorbuttonsh\" value=\"Online Pay\" />
                          </a>
                        </div>
                              </form>";

Thanks
Bala
0
Comment
Question by:gstalin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
HardJeans earned 2000 total points
ID: 17157635
View the source of the HTML file that PHP outputs to create the form.  Does the return URL show up correctly?  Can you copy/paste it into the address bar, and it shows correctly with the GET variables?  Here's a better way to clarify to PHP what you want to treat as a string, and what you want to treat as a var etc...:

echo '<form id="form1" name="upfrm" method="post" action="https://www.paypal.com/cgi-bin/webscr">'."\n";
echo '                      <div align="center">'."\n";
echo '                      <input type="hidden" name="cmd" value="_xclick" />'."\n";
echo '           <input type="hidden" name="business" value="'.$pemail.'" />'."\n";
echo '            <input type="hidden" name="item_name" value="Images in DNB PHOTOGRAPHY" />'."\n";
echo '                        <input type="hidden" name="cart_id" value="'.$cart_id.'" />'."\n";
echo '                        <input type="hidden" name="amount" value="'.$totp.'" />'."\n";
echo '                        <input type="hidden" name="first_name" value="'.$name.'" />'."\n";
echo '                        <input type="hidden" name="currency_code" value="USD" />'."\n";
echo '                        <input type="hidden" name="uid" value="'.$uid.'" />'."\n";
echo '                        <input type="hidden" name="cn" value="DNB PHOTOGRAPHY  payment gateway!" />'."\n";
echo '<input type="hidden" name="return" value="'.$site_url.'/bala/thanks.php?total='.$totp.'&cart_id='.$cart_id.'&uid='.$uid.'" />'."\n";
echo '                <input type="hidden" name="cancel_return" value="'.$site_url.'/bala/thanks.php?total='.$totp.'&cart_id='.$cart_id.'&uid='.$uid.'&fail=fail" />'."\n";
echo '                          <input name="Submit" type="submit" class="colorbuttonsh" value="Online Pay" />."\n";
echo '                          </a>'."\n";
echo '                        </div>'."\n";
echo '                         </form>'."\n";

^^ This way you don't have to remember if you escaped this character, or that character etc...Use single quotes around text, then concatenate it with a variable (.$var.), and continue on with a single quote string.
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question