|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
create and send a form server sideHi,
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! Giorgio wrote:
> Hi, http://www.aspfaq.com/show.asp?id=2173> 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: -- HTH, Bob Barrows
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? Giorgio wrote:
>> See: ?? You've never heard of Response.Redirect?>> 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? 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 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). 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) Giorgio wrote:
> Thanks for reply. Well, the article I posted talks specifically about this.> 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). -- 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" "Bob Barrows" <reb01501@NOyahoo.SPAMcom> ha scritto nel messaggio I tried: I can only show page2 content (without style because page2 is on 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. 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> 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... The code you're using posts the data on the server side from page1 to page2, >> 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> 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 > The code you're using posts the data on the server side from page1 to Thanks,> 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! 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? 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 Relative links are fixable (you just need to insert the full URLs into the >> 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? 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 Giorgio wrote:
Show quoteHide quote > "Bob Barrows" <reb01501@NOyahoo.SPAMcom> ha scritto nel messaggio I'm afraid you are out of luck. You cannot transfer a posted request to a > 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> 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"
Scripting.FileSystemObject GetFile method
Calling a javascript/jQuery from ASP.NET C#? Sharing session variables between applications Validation of viewstate MAC failed. How to generate random no on Priority basis string encryption Passing Hidden Field Values To Other Forms CDONTS issue - Not Working after server migration blank frame in ie6/7 Too Many 401 errors in IIS Log when accessing WebResource.axd |
|||||||||||||||||||||||