|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Enthusiast
![]() Join Date: Jun 2003
Location: India
Posts: 80
|
How to POST to another page
Hi
Is there a way I can POST data from a ASP page to another page? I am not trying to POST data from a form to another page, but would like to create the POST headers from different variables, and then send it to another page. Hope I am clear in my question. Amitabh |
|
|
|
|
|
#2 |
|
Do or do not, there is no try
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2001
Location: The Central Plains
Posts: 3,244
|
you can send them through the url string or place them in a cookie.
__________________
:: Bill :: [billbolte.com] [Old Barn Photographs][PrezBaby.com] [Christian Music Reviews] [Plains Hunter] |
|
|
|
|
|
#3 |
|
SitePoint Enthusiast
![]() Join Date: Jun 2003
Location: India
Posts: 80
|
I can't append them in a query string, and I can't use cookies too. I need it to POST data to a different server.
|
|
|
|
|
|
#4 |
|
Do or do not, there is no try
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2001
Location: The Central Plains
Posts: 3,244
|
oops. totally misread that. hmmmm. you'll have to forgive me but i need a little more info. how is the other server getting or using the data?
could xml work here? i've used the xml and http objects to move data between servers.
__________________
:: Bill :: [billbolte.com] [Old Barn Photographs][PrezBaby.com] [Christian Music Reviews] [Plains Hunter] |
|
|
|
|
|
#5 |
|
SitePoint Wizard
![]() ![]() Join Date: Jun 2003
Location: Andromeda Galaxy
Posts: 4,487
|
You can use the querystrings, there's no problem in that, & it works across different servers. But it has limitations & you can't pass on large amount of data, just a few small variables.
Another way is to send it using SOAP.
__________________
Our lives teach us who we are. ![]() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Me - My Photo Blog - My Hindi Blog - My Blog iG:Syntax Hiliter -- Colourise your WordPress code!! |
|
|
|
|
|
#6 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2003
Location: San Diego, CA
Posts: 590
|
Is it from a link? Cause couldn't you have a hidden form with all hidden variables, and submit it with the link? The link would be something like javascript:document.form_name.submit(); Would this work?
|
|
|
|
|
|
#7 | |
|
SitePoint Member
Join Date: Mar 2004
Location: Santa Monica, CA
Posts: 19
|
There's a com object that I use quite a bit called URLFetch which supports direct posts (even via HTTPS). I've used it to make some simple spiders that post to a form and then parse the response.
Check it out at: http://www.screen-scraper.com/urlfetch/doc.shtml --HH Quote:
|
|
|
|
|
|
|
#8 |
|
Phil
![]() ![]() ![]() ![]() ![]() ![]() Join Date: May 2002
Location: Jacksonville, FL
Posts: 1,171
|
__________________
Jacksonville website design |
|
|
|
|
|
#9 |
|
SitePoint Enthusiast
![]() Join Date: Jun 2003
Location: India
Posts: 80
|
Sorry for the late reply, but the remote server only accepts POST method. It will return some data based on the values that I post. XML is an option that I have, but since I ahve no idea of an XML, I was thinking the other way.
|
|
|
|
|
|
#10 |
|
The doctor is in...
![]() Join Date: Jan 2002
Location: London
Posts: 3,536
|
You actually don't need to know/understand/use XML to use the XMLHTTP component - it's just a standard HTTP component that has a few XML-friendly features. Read up in the link that fillup07 posted, and in the XML reference documentation. Make sure you use Microsoft.ServerXMLHTTP, not the (client-side) Microsoft.XMLHTTP.
Alternatively, cut out the middleman and use WinHTTP. ![]()
__________________
MarcusJT - former ASP web developer / former SPF "ASP Guru" - *very* old blog with some useful ASP code - Please think, Google, and search these forums before posting! |
|
|
|
|
|
#11 | |
|
SitePoint Wizard
![]() ![]() Join Date: Jun 2003
Location: Andromeda Galaxy
Posts: 4,487
|
Quote:
![]()
__________________
Our lives teach us who we are. ![]() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Me - My Photo Blog - My Hindi Blog - My Blog iG:Syntax Hiliter -- Colourise your WordPress code!! |
|
|
|
|
|
|
#12 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Sep 2003
Location: Kingston
Posts: 245
|
I've done this before very simply by having an asp page which retrieves data from a database and populates a form whose ACTION is a page on another server. The page then auto-submits by using a bit of javascript (onload=document.form.submit).
It' s been used every day for about 2 years and has worked perfectly every time. |
|
|
|
|
|
#13 |
|
SitePoint Wizard
![]() ![]() Join Date: Jun 2003
Location: Andromeda Galaxy
Posts: 4,487
|
Yeah but the problem with this is, if the user has JavaScript disabled, nothing will be done.
Its better to do this kinda stuff on the predictable server, rather than relying on un-predictable client.
__________________
Our lives teach us who we are. ![]() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Me - My Photo Blog - My Hindi Blog - My Blog iG:Syntax Hiliter -- Colourise your WordPress code!! |
|
|
|
|
|
#14 |
|
SitePoint Zealot
![]() ![]() Join Date: Oct 2003
Location: South of Rio Grande
Posts: 124
|
|
|
|
|
|
|
#15 | |
|
The doctor is in...
![]() Join Date: Jan 2002
Location: London
Posts: 3,536
|
Has anyone actually read my post?
Quote:
__________________
MarcusJT - former ASP web developer / former SPF "ASP Guru" - *very* old blog with some useful ASP code - Please think, Google, and search these forums before posting! |
|
|
|
|
|
|
#16 |
|
Phil
![]() ![]() ![]() ![]() ![]() ![]() Join Date: May 2002
Location: Jacksonville, FL
Posts: 1,171
|
Now why would he want a good solution that doesn't require a component by a 3rd party? ...
__________________
Jacksonville website design |
|
|
|
|
|
#17 |
|
SitePoint Enthusiast
![]() Join Date: Jun 2003
Location: India
Posts: 80
|
Thanks everybody. I am testing the option sugegsted by M@cro. Hopefully, I should be able to accomplish my goals.
|
|
|
|
|
|
#18 | |
|
SitePoint Wizard
![]() ![]() Join Date: Jun 2003
Location: Andromeda Galaxy
Posts: 4,487
|
Quote:
but it seems like neither amitabh has read it nor other people. ![]()
__________________
Our lives teach us who we are. ![]() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Me - My Photo Blog - My Hindi Blog - My Blog iG:Syntax Hiliter -- Colourise your WordPress code!! |
|
|
|
|
|
|
#19 |
|
SitePoint Zealot
![]() ![]() Join Date: Apr 2002
Location: Sydney, Australia
Posts: 173
|
Like M@rco suggested, WinHTTP is your best bet. It comes pre-installed with Win2k Service Pack 3 or Win2k3 Server so if your server is anything less you may not be able to use it. I think you can download the component from Microsoft standalone and install it anyway but I can't remember.
Alternatively, there's another thing you can use. I have some code stashed away somewhere and it's using the Inet ctl something or other. Let me know if you want it. |
|
|
|
|
|
#20 | |
|
SitePoint Enthusiast
![]() Join Date: Jun 2003
Location: India
Posts: 80
|
Quote:
|
|
|
|
|
|
|
#21 |
|
SitePoint Wizard
![]() ![]() Join Date: Jun 2003
Location: Andromeda Galaxy
Posts: 4,487
|
good. just thought that you could post the feedback if you get it right, not that its necessary.
__________________
Our lives teach us who we are. ![]() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Me - My Photo Blog - My Hindi Blog - My Blog iG:Syntax Hiliter -- Colourise your WordPress code!! |
|
|
|
|
|
#22 |
|
SitePoint Enthusiast
![]() Join Date: Jun 2003
Location: India
Posts: 80
|
Thanks M@rco. I was trying to get some financial data from a brokers site, and it really did help.
|
|
|
|
|
|
#23 | |
|
SitePoint Member
Join Date: Aug 2006
Posts: 1
|
problem with WINHTTP Can someone help?
Quote:
However when I post and try to get the values of the form using request variables I am unable to get the value.Can you please suggest accordingly? |
|
|
|
|
|
|
#24 | |
|
The doctor is in...
![]() Join Date: Jan 2002
Location: London
Posts: 3,536
|
Quote:
PS - Hello everyone! Thought I'd drop in and say hello... it's been a while... what have I missed?! ![]()
__________________
MarcusJT - former ASP web developer / former SPF "ASP Guru" - *very* old blog with some useful ASP code - Please think, Google, and search these forums before posting! |
|
|
|
|
|
|
#25 |
|
Non-Member
![]() ![]() ![]() Join Date: Jul 2006
Posts: 217
|
I dont know if this will work but in flash if you use the "get" method from an ASP page on the asp page you have to type response.write("variable=content+morecontent")
You pretty much write it out like a real post statement. + = space between words.... you can also use &secondvariable=content&thirdvariable=content and so on... |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 09:23.










but it seems like neither amitabh has read it nor other people.



Linear Mode
