Solved

Pay pal return URL  problem

Posted on 2006-07-17
3
264 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
3 Comments
 
LVL 1

Accepted Solution

by:
HardJeans earned 500 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP query / monitor data from Telnet to MySQL 8 100
Ajax and PHP 4 49
PHP: Filling Out/Creating a PDF 29 113
WordPress  Failed to Import Media 6 12
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

696 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