| Author |
Topic Search Topic Options
|
Necronom
Groupie
Joined: 19 October 2001
Location: United States
Status: Offline
Points: 116
|
Post Options
Thanks(0)
Quote Reply
Topic: How to post data w/o users Posted: 28 March 2005 at 3:02pm |
|
how I can post data from an ASP page to another without user interaction?
I'm trying to have a user submit a form from page1.asp to page2.asp, and then in page2.asp I want it to post the data to page3.asp on another server automatically. Kinda like Response.Redirect, but I want it to pass data, and not in a QueryString.
Thanks!
. necronom .
|
|
|
 |
michael
Senior Member
Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 March 2005 at 3:49pm |
|
you will have to put the data somewhere where both servers can get to it. Use SQL Server or create a webservice on the other server and post it that way.
|
|
|
 |
Eray
Newbie
Joined: 28 March 2005
Status: Offline
Points: 2
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 March 2005 at 4:02pm |
|
Hidden fields with a Request.Form("VarNameHere") value attached to it could work.
BUT the user has to press the submit button, and I can't find any ASP
code to change that, you could try JavaScript(google told me that it
can be done) or, if SQL is to much for you (if) you could try writing
to a .txt file, and read it from there in the next page.
|
 |
Necronom
Groupie
Joined: 19 October 2001
Location: United States
Status: Offline
Points: 116
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 March 2005 at 4:03pm |
|
Let me clarify:
page1:
<form action="page2.asp" method="post">
<input name="username" type="text">
<submit value="submit>
</form>
* User clicks on submit and is sent to page2.asp *
page2:
<%
strUsername = Request("username")
...
' open data base WHERE fldUsername = '" & strUsername
strDogsName = rsUsers("fldDogsName")
...
' This is the area I'm looking for (This code is ficticious)
Set FormDate=(FormPosting.Object)
strURL2Post2 = http://www.someserver.com/page3.asp
' Post data strDogsName to strURL2Post2
FormData.Post(strDogsName,strURL2Post2)
%>
* User does nothing and is sent to page3.asp *
page3:
strFavoriteDogsName = Request.Form("strDogsName")
Response.Write("Their favorite dog's name is " & strFavoriteDogsName)
* User arrives at page3.asp without seeing page2.asp *
TIA!
. necronom .
Edited by Necronom - 28 March 2005 at 4:07pm
|
|
|
 |
pmormr
Senior Member
Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 March 2005 at 8:50pm |
|
you could temporially create a small text file that the other server would copy and then delete... but that could cause some security concerns
|
|
|
 |
michael
Senior Member
Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 March 2005 at 9:29pm |
|
especially as he is crossing servers....
|
|
|
 |
Eray
Newbie
Joined: 28 March 2005
Status: Offline
Points: 2
|
Post Options
Thanks(0)
Quote Reply
Posted: 29 March 2005 at 12:58am |
|
I agree that creating a simple table within in a DB and use SQL to update a specific record would be the best course of action.
Edited by Eray - 29 March 2005 at 12:59am
|
 |
ub3rl337ch3ch
Senior Member
Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
|
Post Options
Thanks(0)
Quote Reply
Posted: 29 March 2005 at 6:51pm |
use js to do this...
<SCRIPT language="JavaScript"> document.myform.submit() </SCRIPT>
that will automatically post the form called myform.
if you want to post the data that has already been posted from page1, just recreate the form on page2, but with all hidden fields and the values as <%= request.form("thefield")%>
|
 |