Home All Groups Group Topic Archive Search About

create and send a form server side

Author
21 May 2009 5:04 PM
Giorgio
Hi,
by clicking a link to an ASP page I'd like to create a form (and send its
data) all server side, the client should only see the page that retrieves
data.

Please help me
Thanks!

Author
21 May 2009 5:49 PM
Bob Barrows
Giorgio wrote:
> Hi,
> by clicking a link to an ASP page I'd like to create a form (and send
> its data) all server side, the client should only see the page that
> retrieves data.
>
See:
http://www.aspfaq.com/show.asp?id=2173
--
HTH,
Bob Barrows
Are all your drivers up to date? click for free checkup

Author
21 May 2009 6:56 PM
Giorgio
Thanks a lot , I'd like this:
- page1 creates and sends the form
- page2 has some Request.Form only.

After page1 sends the  form I'd like to go to page2, not to remain in page1
From the title of your link it seems that I will remain in page1 and only
read page2
Or does that link explain also what I'd like to do?
Author
21 May 2009 7:24 PM
Bob Barrows
Giorgio wrote:
>> See:
>> http://www.aspfaq.com/show.asp?id=2173
>
> Thanks a lot , I'd like this:
> - page1 creates and sends the form
> - page2 has some Request.Form only.
>
> After page1 sends the  form I'd like to go to page2, not to remain in
> page1 From the title of your link it seems that I will remain in
> page1 and only read page2
> Or does that link explain also what I'd like to do?

?? You've never heard of Response.Redirect?
See:
http://www.aspfaq.com/show.asp?id=2006
and
http://www.aspfaq.com/show.asp?id=2030

Maybe I am failing to understand your requirements.

--
HTH,
Bob Barrows
Author
21 May 2009 10:27 PM
Giorgio
Thanks for reply.
I forgot to say that I cannot modify page2 (it's on another server).
Page2 requires to have data sent by form's method post cause page2 has
Request.Form.

I'd like to simulate in page1 a form sent by the client but server side (I
have values to send to page2).
Author
22 May 2009 7:31 AM
Evertjan.
Giorgio wrote on 22 mei 2009 in microsoft.public.inetserver.asp.general:

> Thanks for reply.
[...]

???

[please always quote on usenet]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
22 May 2009 11:58 AM
Bob Barrows
Giorgio wrote:
> Thanks for reply.
> I forgot to say that I cannot modify page2 (it's on another server).
> Page2 requires to have data sent by form's method post cause page2 has
> Request.Form.
>
> I'd like to simulate in page1 a form sent by the client but server
> side (I have values to send to page2).

Well, the article I posted talks specifically about this.

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Author
22 May 2009 1:13 PM
Giorgio
"Bob Barrows" <reb01501@NOyahoo.SPAMcom> ha scritto nel messaggio
news:%23hEeyRt2JHA.4116@TK2MSFTNGP04.phx.gbl...
> Giorgio wrote:
>> Thanks for reply.
>> I forgot to say that I cannot modify page2 (it's on another server).
>> Page2 requires to have data sent by form's method post cause page2 has
>> Request.Form.
>>
>> I'd like to simulate in page1 a form sent by the client but server
>> side (I have values to send to page2).
>
> Well, the article I posted talks specifically about this.

I tried: I can only show page2 content (without style because page2 is on
another server) but I still remain in page1 (see addreess bar) and I'm not
redirected to page2 while posting data.
Please could you help me again?

This is my code:
<%
strPostURL =
"http://ecommerce.plusvalore.it:7081/CaricamentoCO/Login/loginTarida.jsp"
strPost =
"fasePagina=check&Lgn_operatore=USERNAME&Lgn_password=PASSWORD&MM_action=true"
set objPost = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
objPost.Open "POST", strPostURL, False
objPost.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objPost.send strPost
strTheResponse = objPost.responseText
Response.write strTheResponse
%>


I'd like to have somethig similar to this (done with javacript see below),
but server side because I dont want to send password to client again.

<form name="form1" method="post" target="_blank"
action="http://ecommerce.plusvalore.it:7081/CaricamentoCO/Login/loginTarida.jsp">
  <input name="fasePagina" type="hidden" value="check">
  <input type="hidden" id="Lgn_operatore" name="Lgn_operatore"
value="USERNAME">
  <input type="hidden" id="Lgn_password" name="Lgn_password"
value="PASSWORD">
  <input type="hidden" id="MM_action" name="MM_action" value="true">
</form>

<script>
    document.form1.submit();
</script>
Author
22 May 2009 1:54 PM
Daniel Crichton
Giorgio wrote  on Fri, 22 May 2009 13:13:44 GMT:


Show quoteHide quote
> "Bob Barrows" <reb01501@NOyahoo.SPAMcom> ha scritto nel messaggio news:%23hEeyRt2JHA.4116@TK2MSFTNGP04.phx.gbl...
>> Giorgio wrote:
>>> Thanks for reply.
>>> I forgot to say that I cannot modify page2 (it's on another server).
>>> Page2 requires to have data sent by form's method post cause page2
>>> has
>>> Request.Form.

>>> I'd like to simulate in page1 a form sent by the client but server
>>> side (I have values to send to page2).

>> Well, the article I posted talks specifically about this.

> I tried: I can only show page2 content (without style because page2 is
> on  another server) but I still remain in page1 (see addreess bar) and
> I'm not  redirected to page2 while posting data.
> Please could you help me again?

> This is my code:
> <%
> strPostURL =
> "http://ecommerce.plusvalore.it:7081/CaricamentoCO/Login/loginTarida.
> jsp"
> strPost =
> "fasePagina=check&Lgn_operatore=USERNAME&Lgn_password=PASSWORD&MM_
> action=true"
> set objPost = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
> objPost.Open "POST", strPostURL, False objPost.setRequestHeader
> "Content-Type", "application/x-www-form-urlencoded"
> objPost.send strPost strTheResponse = objPost.responseText
> Response.write strTheResponse %>


> I'd like to have somethig similar to this (done with javacript see
> below),  but server side because I dont want to send password to client
> again.

> <form name="form1" method="post" target="_blank"
> action="http://ecommerce.plusvalore.it:7081/CaricamentoCO/Login/
> loginTarida.jsp">
>   <input name="fasePagina" type="hidden" value="check">
>   <input type="hidden" id="Lgn_operatore" name="Lgn_operatore"
> value="USERNAME">
>   <input type="hidden" id="Lgn_password" name="Lgn_password"
> value="PASSWORD">
>   <input type="hidden" id="MM_action" name="MM_action" value="true">
>  </form>

> <script>
>     document.form1.submit();
> </script>


The code you're using posts the data on the server side from page1 to page2,
so of course you remain on page1 in the URL. The only way to have it work
the way you expect it to is to get the client to post the form data, and
that will require you to use the second method (and that's client side, not
server side, and by it's nature it *must* be client side). So you have to
decide what is more important - the URL, or the not passing the password to
the client? You cannot have both!

--
Dan
Author
22 May 2009 2:27 PM
Giorgio
> The code you're using posts the data on the server side from page1 to
> page2,
> so of course you remain on page1 in the URL. The only way to have it work
> the way you expect it to is to get the client to post the form data, and
> that will require you to use the second method (and that's client side,
> not server side, and by it's nature it *must* be client side). So you have
> to decide what is more important - the URL, or the not passing the
> password to the client? You cannot have both!

Thanks,
it's more important not passing the password.
But I remain in page1 and, once logged, relative links in page2 are shown
(inside page1) and they will not work.

(Moreover page2 content says that I'm logged but Session variables of page2
are not set cause I'm on page1 server)

Do you know any other solutions?
Author
22 May 2009 3:16 PM
Daniel Crichton
Giorgio wrote  on Fri, 22 May 2009 14:27:26 GMT:


Show quoteHide quote
>> The code you're using posts the data on the server side from page1 to
>> page2, so of course you remain on page1 in the URL. The only way to
>> have it work  the way you expect it to is to get the client to post
>> the form data, and  that will require you to use the second method
>> (and that's client side,  not server side, and by it's nature it
>> *must* be client side). So you have  to decide what is more important
>> - the URL, or the not passing the  password to the client? You cannot
>> have both!

> Thanks, it's more important not passing the password.
> But I remain in page1 and, once logged, relative links in page2 are
> shown  (inside page1) and they will not work.

> (Moreover page2 content says that I'm logged but Session variables of
> page2  are not set cause I'm on page1 server)

> Do you know any other solutions?


Relative links are fixable (you just need to insert the full URLs into the
links in the HTML returned from the API call before sending the browser).
However, there is no way around the session handling - as the client browser
won't send the session identifier to your page so that you can send it in
the API call, your only solution is to use the client side scripted post
with hidden form fields.

--
Dan
Author
22 May 2009 1:57 PM
Bob Barrows
Giorgio wrote:
Show quoteHide quote
> "Bob Barrows" <reb01501@NOyahoo.SPAMcom> ha scritto nel messaggio
> news:%23hEeyRt2JHA.4116@TK2MSFTNGP04.phx.gbl...
>> Giorgio wrote:
>>> Thanks for reply.
>>> I forgot to say that I cannot modify page2 (it's on another server).
>>> Page2 requires to have data sent by form's method post cause page2
>>> has Request.Form.
>>>
>>> I'd like to simulate in page1 a form sent by the client but server
>>> side (I have values to send to page2).
>>
>> Well, the article I posted talks specifically about this.
>
> I tried: I can only show page2 content (without style because page2
> is on another server) but I still remain in page1 (see addreess bar)
> and I'm not redirected to page2 while posting data.
> Please could you help me again?
>
> This is my code:
> <%
> strPostURL =
> "http://ecommerce.plusvalore.it:7081/CaricamentoCO/Login/loginTarida.jsp"
> strPost =
> "fasePagina=check&Lgn_operatore=USERNAME&Lgn_password=PASSWORD&MM_action=true"
> set objPost = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
> objPost.Open "POST", strPostURL, False
> objPost.setRequestHeader "Content-Type",
> "application/x-www-form-urlencoded" objPost.send strPost
> strTheResponse = objPost.responseText
> Response.write strTheResponse
> %>
>
>
> I'd like to have somethig similar to this (done with javacript see
> below), but server side because I dont want to send password to client
> again.
>
> <form name="form1" method="post" target="_blank"
> action="http://ecommerce.plusvalore.it:7081/CaricamentoCO/Login/loginTarida.jsp">
>  <input name="fasePagina" type="hidden" value="check">
>  <input type="hidden" id="Lgn_operatore" name="Lgn_operatore"
> value="USERNAME">
>  <input type="hidden" id="Lgn_password" name="Lgn_password"
> value="PASSWORD">
>  <input type="hidden" id="MM_action" name="MM_action" value="true">
> </form>
>
> <script>
>    document.form1.submit();
> </script>

I'm afraid you are out of luck. You cannot transfer a posted request to a
page on another server. If the page was on the same server, you could use
server.transfer.

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Bookmark and Share