473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Simulate form post from Server Side

Hi,

How do I simulate this from the server side:

<form name="SearchForm" method="POST" id="SearchForm"
action="http://SOMEURL/Search.ASP?Parm1=1&Parm2=2">

I have generally been posting data using:

Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "POST","http://SOMEURL/Search.asp?" & strParmList, False
xml.Send

The above is fine for passing URL parameters, but I need to simulate it
coming from a form which has a name. How do I pass the form name which
is used at the posted URL?

Help!

Sep 26 '07 #1
6 12252
"BarryX" <ba***@praxcom.NOfreeserve.co.SPAMukwrote:
>Hi,

How do I simulate this from the server side:

<form name="SearchForm" method="POST" id="SearchForm"
action="http://SOMEURL/Search.ASP?Parm1=1&Parm2=2">

I have generally been posting data using:

Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "POST","http://SOMEURL/Search.asp?" & strParmList, False
xml.Send

The above is fine for passing URL parameters, but I need to simulate it
coming from a form which has a name. How do I pass the form name which
is used at the posted URL?
AFAIK, the "name" attribute of a form tag really has no meaning and is
never transmitted to the server. On a normal HTML page, if you want to
send an extra bit of data you use a <input type="hidden" element.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov
http://members.cox.net/slatteryt
Sep 26 '07 #2
BarryX wrote:
Hi,

How do I simulate this from the server side:

<form name="SearchForm" method="POST" id="SearchForm"
action="http://SOMEURL/Search.ASP?Parm1=1&Parm2=2">

I have generally been posting data using:

Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "POST","http://SOMEURL/Search.asp?" & strParmList, False
xml.Send

The above is fine for passing URL parameters, but I need to simulate
it coming from a form which has a name. How do I pass the form name
which is used at the posted URL?
1. In server-side code, use Microsoft.ServerXMLHTTP
2. I don;'t think this is possible due to security restrictions. What
are you trying to accomplish?
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Sep 26 '07 #3
Bob Barrows [MVP] wrote on 26 sep 2007 in
microsoft.public.inetserver.asp.general:
BarryX wrote:
>Hi,

How do I simulate this from the server side:

<form name="SearchForm" method="POST" id="SearchForm"
action="http://SOMEURL/Search.ASP?Parm1=1&Parm2=2">
1. In server-side code, use Microsoft.ServerXMLHTTP
2. I don;'t think this is possible due to security restrictions. What
are you trying to accomplish?

<%
url = "http://www.espn.com/main.html"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-
urlencoded"
xmlhttp.send "x=1&y=2"
Response.write xmlhttp.responseText
set xmlhttp = nothing
%>

<http://classicasp.aspfaq.com/general...contents-of-a-
remote-web-page.html>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 26 '07 #4
Evertjan. wrote:
Bob Barrows [MVP] wrote on 26 sep 2007 in
microsoft.public.inetserver.asp.general:
>BarryX wrote:
>>Hi,

How do I simulate this from the server side:

<form name="SearchForm" method="POST" id="SearchForm"
action="http://SOMEURL/Search.ASP?Parm1=1&Parm2=2">

>1. In server-side code, use Microsoft.ServerXMLHTTP
2. I don;'t think this is possible due to security restrictions. What
are you trying to accomplish?


<%
url = "http://www.espn.com/main.html"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-
urlencoded"
xmlhttp.send "x=1&y=2"
Response.write xmlhttp.responseText
set xmlhttp = nothing
%>

<http://classicasp.aspfaq.com/general...contents-of-a-
remote-web-page.html>
I'm not sure what your point is ... how does this help the OP accomplish
his task?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Sep 26 '07 #5
Bob Barrows [MVP] wrote on 26 sep 2007 in
microsoft.public.inetserver.asp.general:
Evertjan. wrote:
>Bob Barrows [MVP] wrote on 26 sep 2007 in
microsoft.public.inetserver.asp.general:
>>BarryX wrote:
Hi,

How do I simulate this from the server side:

<form name="SearchForm" method="POST" id="SearchForm"
action="http://SOMEURL/Search.ASP?Parm1=1&Parm2=2">

>>1. In server-side code, use Microsoft.ServerXMLHTTP
2. I don;'t think this is possible due to security restrictions.
What are you trying to accomplish?


<%
url = "http://www.espn.com/main.html"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-
urlencoded"
xmlhttp.send "x=1&y=2"
Response.write xmlhttp.responseText
set xmlhttp = nothing
%>

<http://classicasp.aspfaq.com/general...contents-of-a-
remote-web-page.html>
I'm not sure what your point is ... how does this help the OP
accomplish his task?
Oops, I should have quoted Shakespeare, not aspfaq.

["A form by any other name ..."]
<%
url = "http://www.espn.com/main.html"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-
urlencoded"
xmlhttp.send "theFormName=myNewForm"
Response.write xmlhttp.responseText
set xmlhttp = nothing
%>

[Doing what html can only do in a (possibly hidden) input]
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 26 '07 #6

This looks promising Evertjan.

Will mess with it. Thanks.
"Evertjan." <ex**************@interxnl.netwrote in message
news:Xn********************@194.109.133.242...
Bob Barrows [MVP] wrote on 26 sep 2007 in
microsoft.public.inetserver.asp.general:
Evertjan. wrote:
Bob Barrows [MVP] wrote on 26 sep 2007 in
microsoft.public.inetserver.asp.general:

BarryX wrote:
Hi,

How do I simulate this from the server side:

<form name="SearchForm" method="POST" id="SearchForm"
action="http://SOMEURL/Search.ASP?Parm1=1&Parm2=2">

1. In server-side code, use Microsoft.ServerXMLHTTP
2. I don;'t think this is possible due to security restrictions.
What are you trying to accomplish?

<%
url = "http://www.espn.com/main.html"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-
urlencoded"
xmlhttp.send "x=1&y=2"
Response.write xmlhttp.responseText
set xmlhttp = nothing
%>

<http://classicasp.aspfaq.com/general...contents-of-a-
remote-web-page.html>
I'm not sure what your point is ... how does this help the OP
accomplish his task?

Oops, I should have quoted Shakespeare, not aspfaq.

["A form by any other name ..."]
<%
url = "http://www.espn.com/main.html"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-
urlencoded"
xmlhttp.send "theFormName=myNewForm"
Response.write xmlhttp.responseText
set xmlhttp = nothing
%>

[Doing what html can only do in a (possibly hidden) input]
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Sep 29 '07 #7

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

Similar topics

1
by: Luis Faisco | last post by:
Hi, my problem may be trivial but I have been searching for an answer to this on the web without success. Hope you can help. This is the scenario: I am making a wizard composed of several...
3
by: q2005 | last post by:
Hi, all Is that possible I can do window.open("http://xserver1/app/typ/test/tesServer.php?aaa=111&bbb=222&ccc= 333","","") to simulate a POST ACTION with a form rather than a GET ACTION? Jack
11
by: Tom | last post by:
Hi all, I posted the same question one week ago in http://communities.microsoft.com/newsgroups/previewFrame.as p? ICP=msdn&sLCID=us&sgroupURL=microsoft.public.dotnet.framewo...
4
by: Al Cadalzo | last post by:
I'm trying to simulate a form post (i.e. Method="POST"). The FORM POST I'm trying to simulate is similar to this: <FORM NAME=SearchForm METHOD=POST ACTION=Search> <SELECT name="criteriaA" >...
8
by: Gert | last post by:
Hi, I have a form (server side) because of the filling of variables through the application. But now I need to post it to an url on submit. My .HTML form looks like this, but how to translate it...
1
by: BarryX | last post by:
Hi, How do I simulate this from the server side: <form name="SearchForm" method="POST" id="SearchForm" action="http://SOMEURL/Search.ASP?Parm1=1&Parm2=2"> I have generally been posting data...
19
by: klenwell | last post by:
Another request for comments here. I'd like to accomplish something like the scheme outlined at this page here: http://tinyurl.com/3dtcdr In a nutshell, the form uses javascript to hash...
0
by: nospam | last post by:
Hello, I want to simulate posting to a form method with some data. I don't want to use query strings. I want to 'submit' to a php method with some form fields filled out on the server. So,...
1
by: starter08 | last post by:
Hi, I have a C++ routine(client-side) which uploads an xml file to a web server by making a socket connection and sending all the post request through that socket. On the server side I have a cgi...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.