Solved

Paypal BuyNow button is not  re directing to the paypal website

Posted on 2011-09-29
5
265 Views
Last Modified: 2012-05-12
On my paypal account I have created a buynow button. Copied pasted the html on my webpage but after clicking the button, Its not getting redirected to the paypal website for the payment. I have tried the button in three browsers IE firefox and chrome, created a new  buynow button  but still no luck. I am using asp.net c# on windows 7. Any ideas why it could be happening?
0
Comment
Question by:mmalik15
  • 3
  • 2
5 Comments
 
LVL 6

Expert Comment

by:rknetwork
ID: 36816032
How about pasting a source code here?
0
 

Author Comment

by:mmalik15
ID: 36816068
here is the code thanks

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="M7Z2QNQMGJ6WS">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
0
 
LVL 6

Expert Comment

by:rknetwork
ID: 36816117
Works just fine by itself. Please paste here the source of the whole page (from the browser).

or try using this code instead:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="M7Z2QNQMGJ6WS">
<button><img src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0"></button>
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
0
 

Author Comment

by:mmalik15
ID: 36816342
I have attached the html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
  
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8" />
    <meta name="cache-control" content="no-cache" />
    <meta name="language" content="en" />
    <title>Home - Life in the UK</title>
    <meta name="keywords" content="Home" />

    <meta name="description" content="Home" />
    <link href='Skins/MyCustomSkin/Button.MyCustomSkin.css' rel="stylesheet" media=all type="text/css" />
   <link type="text/css" rel="stylesheet" media="all" href='CSS/styles.css' />
    <link type="text/css" rel="stylesheet" media="all" href='CSS/ac.css' />
   


</head>


<body >
    <form method="post" action="Payment.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />

<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTY1NDU2MTA1Mg9kFgJmD2QWAmYPZBYCAgEPFgIeB1Zpc2libGVoZGRlxFk2uPk2QIFcEQM4l6eOERw8zIkn7Vot9TBGL7/MvA==" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>


<div class="aspNetHidden">

	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwLZnfyXBQK3zebFCQKE9pjfCLvZYTCNL9BOqGvWxb1mnN6LUZG9c189IcQadwLMAGaG" />
</div>
    <div id="Div1" style="padding-top: 8px;">
    </div>

    <div id="wrapp"  >
       
        <header id="header">

         <div id="TopLinksLogin" class="TopLinksStyle">
            <ul  style="list-style-type:none; font-weight:bold;">
                <li style="display:inline;">
                    <a id="lbtnRegister" class="NoUnderline" href="javascript:__doPostBack(&#39;ctl00$lbtnRegister&#39;,&#39;&#39;)">Register</a></li>
                <li style="display:inline;"> | </li>

                <li style="display:inline;">
                    <a id="lbtnLogin" href="javascript:__doPostBack(&#39;ctl00$lbtnLogin&#39;,&#39;&#39;)">Login</a></li>
            </ul>
        </div>
        
        
		<h1><a href="http://localhost/LifeInTheUK/PL/Home.aspx" style=" vertical-align:bottom;" title="Life in the UK">Life in the UK</a></h1>
		<nav>
			<ul>
				<li><a href='Home.aspx'   > Home</a></li>

				<li><a href='Register.aspx' >  Register</a></li>
				<li><a href='AboutTest.aspx'  >     About Test</a></li>
				<li><a href='Book.aspx'  >  Study meterial</a></li>
				<li><a href='FreeTest.aspx'  >    Free sample test</a></li>
                <li><a href='Testimonials.aspx'  > Customer testimonial</a></li>

			</ul>
		</nav>
	
		<div class="clear"></div>
	</header>
        <div id="MainContent" style="padding-left: 0px; border: 1px; float:left;" class="LeftColumnRegister">
            

        </div>
        <div id="Div2" style=" border: 1px; float:left;" class="RightColumnRegister">
            
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">

<input type="hidden" name="hosted_button_id" value="M7Z2QNQMGJ6WS">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>



        </div>

         <footer id="footer"  >
     
            <table   cellspacing=0px cellpadding=0px  style="font-weight: bold; text-align: center; font-family:Verdana;
                width:40%; height:60%;  padding-top:5px;  margin-left:30%; margin-right: 30%; color: White; ">
                <Br />
                <tr>

                    <td>
                        <a href="http://localhost/LifeInTheUK/PL/Home.aspx">Home</a>
                    </td>
                    <td style="font-weight: bold;">
                        |
                    </td>
                    <td>
                        <a href="http://localhost/LifeInTheUK/PL/Register.aspx">Register</a>

                    </td>
                    <td style="font-weight: bold;">
                        |
                    </td>
                    <td>
                        <a href="http://localhost/LifeInTheUK/PL/FreeTest.aspx">Free Sample Test</a>
                    </td>
                    <td style="font-weight: bold;">
                        |
                    </td>

                    <td>
                        <a href="http://localhost/LifeInTheUK/PL/Sitemap.aspx">Site Map</a>
                    </td>
                    <td style="font-weight: bold;">
                        |
                    </td>
                    <td>
                        <a href="http://localhost/LifeInTheUK/PL/contactus.aspx">Contact US</a>

                    </td>
                </tr>
                <tr>
                    <td colspan=9 align=center style="font-size:10px; word-spacing:1px; padding-top:0px;">© Copyright 2011. practicelifeintheuktest.co.uk All Rights Reserved
                    </td>
                </tr>
              
            </table>

	</footer>
          
   
    
    </div>

    </form>
</body>
</html>

Open in new window

0
 
LVL 6

Accepted Solution

by:
rknetwork earned 500 total points
ID: 36816353
Got it.
Your first <form> tag is not closed before Paypal's is opened.

    <form method="post" action="Payment.aspx" id="form1">

Move </form> from line 156 to line 30
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
How important is it to take extra precautions to protect your online business? These are some steps you can take to make sure you're free of any cyber crime.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

867 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now