Parsing information between pages in ASP - asp-classic

What I want to happen is when the user chooses the amount they want they click on submit. Now that amount will be passed on to the next page.
The problem is I dont understand the code in the handler, does any know a simple bit of code i can get to make this happen?
Sorry but I am not clear with asp and asp.net
Thanks
<form id='sampleform' method='post' action='handler.asp' >
<p>
Name: <input type='text' name='Name' />
</p>
<p>
Email: <input type='text' name='Email' />
</p>
<input type="radio" name="subject" value="ten" /> £10
<input type="radio" name="subject" value="five" /> £5
<input type="radio" name="subject" value="three" /> £3
£<input type='text' name='donate-amount' />
<p>
<input type='submit' name='Submit' value='Submit' />
</p>
</form>

It would help if I could see the code in handler.asp. Try the following as your handler.asp page
<%=Request.Form("Name")%> <br />
<%=Request.Form("Email")%> <br />
<%=Request.Form("subject")%> <br />
<%=Request.Form("donate-amount")%> <br />

Related

Paypal IPN not being fired

I have the below form sent to Paypal's sandbox from my production Server
<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" name="paypalFOrm">
<input type="hidden" value="_xclick-subscriptions" name="cmd">
<input type="hidden" value="a.user#gmail.com" name="business">
<input type="hidden" value="A Subscription" name="item_name">
<input type="hidden" value="10" name="item_number">
<input type="hidden" value="USD" name="currency_code">
<input type="hidden" value="1" name="no_note">
<input type="hidden" value="10" name="a3">
<input type="hidden" value="1" name="p3">
<input type="hidden" value="M" name="t3">
<input type="hidden" value="http://a.com/ThankYou.aspx?from=pc" name="return">
<input type="hidden" value="http://a.com/IPN.aspx" name="notify_url">
<input type="hidden" value="1" name="src">
<input type="image" alt="" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_SM.gif" name="submit">
<img border="0" width="1" height="1" alt="" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif">
When I test the IPN using IPN simulator, it works fine however when I make test payments, no IPN is fired. Please advise if I am doing something wrong here.
Subscriptions won't work from notify_url. You'll have to setup IPN in the PayPal account profile to trigger subscription based IPNs.

Submit form that posts to another site

I have an online banking login that I'm trying to take from an old client site and put on their new site. If I copy the form and paste it into my new site, it just reloads the page when submitted. I've tried to change it to an asp.net form using the appropriate and other applicable tags with the same result.
If I take the form and put it in a simple index.html file, it submits and takes me to the correct external site.
I was unable to set the ID & values with the asp.net form and that may be one of the issues.
Any help is appreciated.
Here is the HTML form version that works in .html page that needs to work in .aspx page:
<form action="some external site" method="POST" autocomplete="OFF" target="_top">
<input type="hidden" name="sssid" value="my value">
<input type="hidden" name="iid" value="another value">
<div class="field-container">
<label for="aid" id="aid-label">Access ID</label>
<input name="aid" id="aid" type="text" size="8" onFocus="toggle_label(this, 'focus');" onBlur="toggle_label(this,'blur');" />
</div>
<div class="field-container">
<label for="passcode" id="passcode-label">Passcode</label>
<input name="passcode" id="passcode" type="password" size="8" onFocus="toggle_label(this, 'focus');" onBlur="toggle_label(this,'blur');"/>
</div>
<div class="form-row">
<input type="submit" name="Submit" value="Go" class="button">
</div>
</form>
Here is my asp.net form version that I tried:
<form action="some external site" method="POST" autocomplete="OFF" target="_top">
<input type="hidden" name="sssid" value="some value">
<input type="hidden" name="iid" value="another value">
<asp:TextBox runat="server" ID="sssid" CssClass="form-control" type="hidden" ClientIDMode="Static"></asp:TextBox>
<asp:TextBox runat="server" ID="iid" CssClass="form-control" type="hidden" ClientIDMode="Static"></asp:TextBox>
<div class="form-group">
<asp:Label runat="server" id="lblAccessID"></asp:Label>
<asp:TextBox runat="server" ID="txtAccessID" CssClass="form-control"> </asp:TextBox>
</div>
<div class="form-group">
<asp:Label runat="server" id="lblPassCode"></asp:Label>
<asp:TextBox runat="server" ID="txtPasscode" CssClass="form-control" TextMode="Password"></asp:TextBox>
</div>
<button type="submit" class="btn btn-blue">GO
<img src="/Content/img/icon-sm-arrow.png" alt="" />
</button>
</form>
My asp.net form code behind:
protected void Page_Load(object sender, EventArgs e)
{
txtAccessID.Attributes.Add("placeholder", "Access ID");
txtPasscode.Attributes.Add("placeholder", "Passcode");
}
I had to use the following to post this correctly:
<asp:LinkButton runat="server" ID="btnSubmit" CssClass="btn btn-blue" PostBackUrl="urlhere" Text='GO <img src="/Content/img/icon-sm-arrow.png" alt="" />' />
set PostBackUrl property of Button control => https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.postbackurl(v=vs.110).aspx
the reason webforms always posting it 2 itself may be due to their __doPostBack script.

I wanna adjust submit button and text same level

The following is my code and I have been trying to make the text fields and submit button to the same level. I do not have a style script with it though:
<table width="200" border="1">
<tbody>
<tr>
<td>
<form action="http://www.aweber.com/scripts/addlead.pl" method="post">
<div style="display: none;">
<input type="hidden" name="meta_web_form_id" value="1557121664" />
<input type="hidden" name="meta_split_id" value="" />
<input type="hidden" name="listname" value="perfumestore" />
<input id="redirect_55278f131e8a7214d84411f07f48b533" type="hidden" name="redirect" value="http://www.aweber.com/thankyou.htm?m=default" />
<input type="hidden" name="meta_adtracking" value="Frontpage" />
<input type="hidden" name="meta_message" value="1" />
<input type="hidden" name="meta_required" value="email" />
<input type="hidden" name="meta_tooltip" value="" />
</div>
<div align="right">
<input id="awf_field-61288568" tabindex="500" type="text" name="email" value="" onFocus=" if (this.value == '') { this.value = ''; }" onBlur="if (this.value == '') { this.value='';} " />
<input type="submit" name="submit" value="Submit"/>
<div>
</div>
</div>
</div>
</form>
you can add inline styles for the div as well as input.
add align="left" or align="right"
you can use Float, padding also.
hope this helps

Input amount for a PayPal Buy Now button?

I'd like the user to be able to type the amount they wish to pay into a text box, then click "Buy Now", and that amount will be charged through PayPal. How do I go about creating a PayPal button like this?
Success! For anyone else having this problem, here is the code I used:
<form name="input" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="YOUR BUSINESS NAME">
<input type="hidden" name="item_name" value="ITEM NAME">
<input type="hidden" name="item_number" value="ITEM ID NUMBER">
Other amount: $<input type="text" maxlength="200" style="width:50px;" name="amount" value="5.00"> CAD<br />
<input type="hidden" name="currency_code" value="CAD">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_SM.gif" border="0" alt="PayPal - The safer, easier way to pay online!">
</form>

Error: Redirect to a localhost from a Paypal sandbox IPN

I have implemented a Paypal structure
through my page button it direct to a paypal sandbox,
payment being performed.
form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="abhish_1347270213_biz#gmail.com" />
<input type="hidden" name="item_name" value="Red Jacket" />
<input type="hidden" name="item_number" value="7601" />
<input type="hidden" name="amount" value="125.00" />
<input type="hidden" name="no_shipping" value="2" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="bn" value="PP-BuyNowBF" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0"
name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1"
height="1" />
<input type="hidden" name="return" value="localhost:53237/WebSite17/Default.aspx" />
<div></div>
</form>
Now when i am trying to redirect to a localhost, its showing an error.
I need to ask is it possible to redirect to a localhost from a paypal, and if it is possible then how shall i implement this. thanks for any assistance.
try http:// in front of the localhost
In place of
<input type="hidden" name="return" value="localhost:53237/WebSite17/Default.aspx" />
place
<input type="hidden" name="return" value="http://localhost:53237/WebSite17/Default.aspx" />
and for IPN notification
place
<input type="hidden" name="notify_url" value="http://localhost:53237/WebSite17/Default.aspx" />
It will redirect to the site with the return Value Varifiedfor the transaction.

Resources