473,657 Members | 2,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

automatic ASP page submission?

I'm trying to automatically submit a form to another ASP page after
some <input> fields values are filled by ASP.

I know I can do it using javascript, but is there a way to
automatically submit the form using VBscript?

Terry

<%
' ... some asp processing
value1 = "something"
value2 = "somethinge lse"
%>

<form method="post" action="mynextp age.asp" id="form1" name="form1">
<input TYPE="hidden" name="var1" VALUE=" & <%=value1%> & ">"
<input TYPE="hidden" name="var2" VALUE=" & <%=value2%> & ">"
</form>

<%
' form1.submit() ' this obviously wouldn't do anything
%>
<script language="JavaS cript" type="text/javascript">
// this works but is there a way to do it in vbscript.
form1.submit();
</script>

Jul 19 '05 #1
12 15566
Why do you need to if you're posting to your own page? Can't you just
execute the code on the serveR? Why create a form that has values
determined by ASP code and then submit it back to the same server?

Ray at work

"Terry" <sa********@sha w.ca> wrote in message
news:9a******** *************** *********@4ax.c om...
I'm trying to automatically submit a form to another ASP page after
some <input> fields values are filled by ASP.

I know I can do it using javascript, but is there a way to
automatically submit the form using VBscript?

Terry

<%
' ... some asp processing
value1 = "something"
value2 = "somethinge lse"
%>

<form method="post" action="mynextp age.asp" id="form1" name="form1">
<input TYPE="hidden" name="var1" VALUE=" & <%=value1%> & ">"
<input TYPE="hidden" name="var2" VALUE=" & <%=value2%> & ">"
</form>

<%
' form1.submit() ' this obviously wouldn't do anything
%>
<script language="JavaS cript" type="text/javascript">
// this works but is there a way to do it in vbscript.
form1.submit();
</script>

Jul 19 '05 #2
Terry wrote on 16 dec 2003 in microsoft.publi c.inetserver.as p.general:
I'm trying to automatically submit a form to another ASP page after
some <input> fields values are filled by ASP.

I know I can do it using javascript, but is there a way to
automatically submit the form using VBscript?

Terry

<%
' ... some asp processing
value1 = "something"
value2 = "somethinge lse"
%>

<form method="post" action="mynextp age.asp" id="form1" name="form1">
<input TYPE="hidden" name="var1" VALUE=" & <%=value1%> & ">"
<input TYPE="hidden" name="var2" VALUE=" & <%=value2%> & ">"
</form>

<%
' form1.submit() ' this obviously wouldn't do anything
%>
<script language="JavaS cript" type="text/javascript">
// this works but is there a way to do it in vbscript.
form1.submit();
</script>


<script type="text/vbscript">
form1.submit()
</script>

Only for IE !!!

Why would you want to do that ?

Are you confusing vbs with (asp)serverside and js with clientside ?

=============== ====

Would you want to do this:

<%
session("value1 ")=value1
session("value2 ")=value2
response redirect "myNextpage.asp "
%>

and on "myNextpage.asp "

<%
value1=session( "value1")
value2=session( "value2")
%>

===============

or

<%
response redirect "myNextpage.asp ?"&"value1"&"&" &"value2"
%>

and on "myNextpage.asp "

<%
value1=request. querystring("va lue1")
value2=request. querystring("va lue2")
%>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3
On Mon, 15 Dec 2003 18:50:51 -0500, "Ray at <%=sLocation% >"
<myfirstname at lane34 dot com> wrote:
Why do you need to if you're posting to your own page? Can't you just
execute the code on the serveR? Why create a form that has values
determined by ASP code and then submit it back to the same server?

Ray at work


Ray, Evertjan,

Thank you for the responses.

I will give a little more info. I was trying to keep it short and
probably confused things a bit by saying 'myNextPage.asp ' ... that
page is actually on a 3rd party server.

I am trying to create a standardized ASP page I can call that will
handle 2 (or more) different processing methods for credit cards. One
of our 3rd party vendors accepts a post using a querystring. The
other vendor accepts a form post. So the modified code might look
something like this:

Is there a better to handle this?

Terry

<%
' this ASP page is called by our user's payment form
' .. the page specifies which bankVendor to use.
' ... some initial processing to populate our database
value1 = "something"
value2 = "somethinge lse"
' etc.

if BankVendor="A" then
Response.redire ct "https://www.bankA.com/payment.asp?" & _
"merchant_i d=" & value1 & "&" & "OrdNum=" & value2
elseif BankVendor="B" then
%>
<form method="post" action="https://www.bankB.com/payment.asp"
id="form1" name="form1">
<input TYPE="hidden" name="merchant_ id" VALUE=" & <%=value1%> & ">"
<input TYPE="hidden" name="OrdNum" VALUE=" & <%=value2%> & ">"
</form>

<%
' if BankVendor = "B", then I want to submit the form

<script language="JavaS cript" type="text/javascript">
// this works but is there a way to do it in vbscript.
form1.submit();
</script>
end if

%>

Jul 19 '05 #4
"Terry" <sa********@sha w.ca> wrote in message
news:p4******** *************** *********@4ax.c om...
On Mon, 15 Dec 2003 18:50:51 -0500, "Ray at <%=sLocation% >"
<myfirstname at lane34 dot com> wrote:
Why do you need to if you're posting to your own page? Can't you justexecute the code on the serveR? Why create a form that has values
determined by ASP code and then submit it back to the same server?

Ray at work


Ray, Evertjan,

Thank you for the responses.

I will give a little more info. I was trying to keep it short and
probably confused things a bit by saying 'myNextPage.asp ' ... that
page is actually on a 3rd party server.

I am trying to create a standardized ASP page I can call that will
handle 2 (or more) different processing methods for credit cards. One
of our 3rd party vendors accepts a post using a querystring. The
other vendor accepts a form post. So the modified code might look
something like this:

Is there a better to handle this?

Terry

<%
' this ASP page is called by our user's payment form
' .. the page specifies which bankVendor to use.
' ... some initial processing to populate our database
value1 = "something"
value2 = "somethinge lse"
' etc.

if BankVendor="A" then
Response.redire ct "https://www.bankA.com/payment.asp?" & _
"merchant_i d=" & value1 & "&" & "OrdNum=" & value2
elseif BankVendor="B" then
%>
<form method="post" action="https://www.bankB.com/payment.asp"
id="form1" name="form1">
<input TYPE="hidden" name="merchant_ id" VALUE=" & <%=value1%> & ">"
<input TYPE="hidden" name="OrdNum" VALUE=" & <%=value2%> & ">"
</form>

<%
' if BankVendor = "B", then I want to submit the form

<script language="JavaS cript" type="text/javascript">
// this works but is there a way to do it in vbscript.
form1.submit();
</script>
end if

%>


The following article has a section devoted to posting to an external
resource using MSXML.
http://aspfaq.com/2173

HTH
-Chris Hohmann
Jul 19 '05 #5
Use the link that Chris posted. Are you trying to jerry-rig thins though?
One of your vendors instructs you to grab data from their website and put it
in your own? You'd think they'd offer something to do this for you.

Ray at work

"Terry" <sa********@sha w.ca> wrote in message
news:p4******** *************** *********@4ax.c om...
I will give a little more info. I was trying to keep it short and
probably confused things a bit by saying 'myNextPage.asp ' ... that
page is actually on a 3rd party server.

I am trying to create a standardized ASP page I can call that will
handle 2 (or more) different processing methods for credit cards. One
of our 3rd party vendors accepts a post using a querystring. The
other vendor accepts a form post. So the modified code might look
something like this:

Is there a better to handle this?

Jul 19 '05 #6
Thanks for the great link. That does it.

But just to clarify... I think you might still be confused on my
setup. The initial user form is on our site, which then calls the ASP
page I am referring to (again on our site), and that decides to which
of the other two external sites it is posted to, depending on the bank
type.

thanks again ... Terry
On Mon, 15 Dec 2003 20:06:28 -0500, "Ray at <%=sLocation% >"
<myfirstname at lane34 dot com> wrote:
Use the link that Chris posted. Are you trying to jerry-rig thins though?
One of your vendors instructs you to grab data from their website and put it
in your own? You'd think they'd offer something to do this for you.

Ray at work

"Terry" <sa********@sha w.ca> wrote in message
news:p4******* *************** **********@4ax. com...
I will give a little more info. I was trying to keep it short and
probably confused things a bit by saying 'myNextPage.asp ' ... that
page is actually on a 3rd party server.

I am trying to create a standardized ASP page I can call that will
handle 2 (or more) different processing methods for credit cards. One
of our 3rd party vendors accepts a post using a querystring. The
other vendor accepts a form post. So the modified code might look
something like this:

Is there a better to handle this?


Jul 19 '05 #7
Thought I had it, but on further review, it is still not working
right.

When I use 'MSXML2.ServerX MLHTTP' to post the page, the resulting URL
that appears ends up being on my computer, rather than the remote
server. So then the resulting buttons on THAT page fail, since they
are referencing relatively ( I suppose).

Am I missing something? Or could it mean there is an installation
problem of MSXML2 on my ISP's server. Any other suggestions?

Terry
Here are the two sample pages:

The html form I would like to simulate (this page will work if you
paste it)
test.html:

<HTML>
<HEAD>
<FORM METHOD="POST"
ACTION="https://esqa.moneris.co m/hosted/index.php">
<INPUT TYPE="HIDDEN" NAME="store_id" VALUE="store1">
<INPUT TYPE="HIDDEN" NAME="charge_to tal" VALUE="1.01">
<INPUT TYPE="HIDDEN" NAME="return_UR L"
VALUE="http://www.yahoo.com">
<INPUT TYPE="HIDDEN" NAME="receipt_U RL"
VALUE="http://www.yahoo.com">
<INPUT TYPE="HIDDEN" NAME="hide_item " VALUE="1">
<INPUT TYPE="HIDDEN" NAME="hide_addr ess" VALUE="1">
<INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Click to proceed to
Secure Page">
</FORM>
</HEAD>
</HTML>

THE ASP page that should(?) submit the info automatically for me:
but, when I run this page, instead of
'https://esqa.moneris.co m/hosted/index.php' appearing in my Browser
address bar, it shows: http://mycomputer/mypath/test2.asp
It might be useful if someone could run this on their server (with
good MSXML2 install) to let me know if they get the same as the HTML
form above, or the same as I do.
=============== =========
test2.asp:

<%@ Language=VBScri pt %>
<HTML>
<HEAD>

<%
dim xmlhttp
url = "https://esqa.moneris.co m/hosted/index.php"
set xmlhttp = server.CreateOb ject("MSXML2.Se rverXMLHTTP")
xmlhttp.open "POST", url, false
xmlhttp.setRequ estHeader "Content-Type",
"applicatio n/x-www-form-urlencoded"

formdata="store _id=store1&" & _
"charge_total=1 .01&" & _
"return_URL = www.yahoo.com&" & _
"receipt_URL=ww w.yahoo.com&" & _
"hide_items =1&" & _
"hide_address=1 "

xmlhttp.send formdata
Response.write xmlhttp.respons eText
set xmlhttp = nothing
%>
</HEAD>
</HTML>



On Mon, 15 Dec 2003 20:06:28 -0500, "Ray at <%=sLocation% >"
<myfirstname at lane34 dot com> wrote:
Use the link that Chris posted. Are you trying to jerry-rig thins though?
One of your vendors instructs you to grab data from their website and put it
in your own? You'd think they'd offer something to do this for you.

Ray at work

"Terry" <sa********@sha w.ca> wrote in message
news:p4******* *************** **********@4ax. com...
I will give a little more info. I was trying to keep it short and
probably confused things a bit by saying 'myNextPage.asp ' ... that
page is actually on a 3rd party server.

I am trying to create a standardized ASP page I can call that will
handle 2 (or more) different processing methods for credit cards. One
of our 3rd party vendors accepts a post using a querystring. The
other vendor accepts a form post. So the modified code might look
something like this:

Is there a better to handle this?


Jul 19 '05 #8
Terry wrote on 16 dec 2003 in microsoft.publi c.inetserver.as p.general:
Here are the two sample pages:

The html form I would like to simulate (this page will work if you
paste it)
test.html:

<HTML>
<HEAD>
<FORM METHOD="POST"
ACTION="https://esqa.moneris.co m/hosted/index.php">
<INPUT TYPE="HIDDEN" NAME="store_id" VALUE="store1">
<INPUT TYPE="HIDDEN" NAME="charge_to tal" VALUE="1.01">
<INPUT TYPE="HIDDEN" NAME="return_UR L"
VALUE="http://www.yahoo.com">
<INPUT TYPE="HIDDEN" NAME="receipt_U RL"
VALUE="http://www.yahoo.com">
<INPUT TYPE="HIDDEN" NAME="hide_item " VALUE="1">
<INPUT TYPE="HIDDEN" NAME="hide_addr ess" VALUE="1">
<INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Click to proceed to
Secure Page">
</FORM>
</HEAD>
</HTML>


I think you are making to many problems for yourself.
why not simply startout with:

=============== =============== ======

<HTML>

<% bank=session("b ankname") %>

<body
onload="documen t.getElementByI d(""myform"").s ubmit()">

<% if bank = "bankA" then %>

<FORM METHOD="POST" id="myform">
ACTION="https://esqa.moneris.co m/hosted/index.php">
<INPUT TYPE="HIDDEN" NAME="store_id" VALUE="store1">
<INPUT TYPE="HIDDEN" NAME="charge_to tal" VALUE="1.01">
<INPUT TYPE="HIDDEN" NAME="hide_item " VALUE="1">
<INPUT TYPE="HIDDEN" NAME="hide_addr ess" VALUE="1">
</FORM>

<% elseif bank = "bankB" then %>

<FORM METHOD="POST" id="myform">
ACTION="https://Bank.b.com/index.php">
<INPUT TYPE="HIDDEN" NAME="store_id" VALUE="store1">
<INPUT TYPE="HIDDEN" NAME="charge_to tal" VALUE="1.01">
<INPUT TYPE="HIDDEN" NAME="hide_item " VALUE="1">
<INPUT TYPE="HIDDEN" NAME="hide_addr ess" VALUE="1">
</FORM>

<% elseif bank = "bankC" then %>

<FORM METHOD="POST" id="myform">
ACTION="https://bank.C.com/hosted/index.php">
<INPUT TYPE="HIDDEN" NAME="store_id" VALUE="store1">
<INPUT TYPE="HIDDEN" NAME="charge_to tal" VALUE="1.01">
<INPUT TYPE="HIDDEN" NAME="hide_item " VALUE="1">
<INPUT TYPE="HIDDEN" NAME="hide_addr ess" VALUE="1">
</FORM>

<% ' else - errorcode for other banks here later? %>

<% end if %>

</Body>
</HTML>

=============== =============== ===

If this works then you can change the codes for the individual banks,
possibly also adding bankspecific serverside code.

You could write the above far mor efficiently,
but the layout of the code would be less clear.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #9
Evertjan. wrote on 16 dec 2003 in microsoft.publi c.inetserver.as p.general:
<FORM METHOD="POST" id="myform">
ACTION="https://bank.C.com/hosted/index.php">


<FORM METHOD="POST" id="myform"
ACTION="https://bank.C.com/hosted/index.php">
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2078
by: Eric Linders | last post by:
Hello, Our company currently processes a few hundred form submissions through our site. Up till now, the contents of the form has been sent to our customer support staff in real-time. Each submission goes to a general e-mail box where it's printed through our mail client. A copy of the form is also stored in a MySQL db, although it's not used that often. I have been asked to figure out a way to stop delivering the form submissions in...
5
5177
by: Alex Hunsley | last post by:
I'm using urllib to post data to a web form by issuing a command similar to this: filename, headers = urllib.urlretrieve("http://www.thewebsitenamehere.com/servlet/com.blah.bloo.XmlFeed", "content.txt", None, urllib.urlencode({"aParameter": "theValue"})) Now, the problem is that the above fails, since I am not sending a session cookie. Visitors to the web sites' html submission form are sent a session cookie which is given back to...
10
3170
by: Manny | last post by:
I have a web form "Page1.asp" and it reads data from a database, does some calculations, and displays the records in pages. Works fine. I have a button that displays on the page, defined as <input type="button" onClick="OutputData()"> The OutputData() function is a javascript function that simply does this: window.location = "Page1.asp?Flag=1";
1
2572
by: Piotr Kurpiel | last post by:
Hi, I am creating a site where I need to refer to another external file (aspx). I create the form and works fine. But as soon as I try to submit the form automatically (with form.submit()) I get an error from the external site. I do not have the code of that site but suppose that my automatic submission does not pass all of the variables. This is how it looks in plain html: <form name="Login" method="post"
12
22096
by: Stanley | last post by:
Hi, I'd like to write a HTML page which can help me directly log in my Yahoo!mail or Gmail account without typing user name and password. Basically, I want to set up a link, click it and pop up the Yahoo/Gmail page. What technology is most appropriate for this kind of work? My current solution is not so satisfying: I download Yahoo!Mail page
6
4868
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
7
2976
by: grpmangr | last post by:
hi Is ther anyway i can automatically fill out forms and submit them thru java? supposing i hav a normal txt file that contains all data that needs to be filed out into the form, is there anyway i can fill out a form and submit it automatically by providing only the URL of the form and the txt file? thanks Najla
4
2820
by: Scott Shuster | last post by:
Hi, I've been searching and testing and have not yet found the answer I'm looking for. I have an ASP.NET (vb) application with an ecommerce function. When the user submits the page, I DON'T want them to be able to click on the 'BACK' button and get back to the form - they may inadvertently re-submit the page and get charged again. I WANT them to get the "Page has expired" message.
6
3296
by: chazzy69 | last post by:
Ok two questions- First is it possible to replicate javascripts automatic submit with a php function, i want to do this due to the fact we i run a cron job it wont run javascript. Second If the above is not possible i need to transfer information from the intial page to another another .php and acts similar to the php form in that when u hit submit it will post the information to the other .php page and then opens that page. The reason...
0
8837
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.