Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

Paypal BuyNow button is not re directing to the paypal website

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
mmalik15
Asked:
mmalik15
  • 3
  • 2
1 Solution
 
rknetworkCommented:
How about pasting a source code here?
0
 
mmalik15Author Commented:
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
 
rknetworkCommented:
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
 
mmalik15Author Commented:
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
 
rknetworkCommented:
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now