Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 10th, 2006, 07:35 PM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with redirect/replace

I am trying to use location.replace and/or location.href to "hide" the initial page (It is started from an application, with parameters as "....htm?x=X1&y=Y1...", and I don't want those parameters to be seen (and in that page I also set a SESSION-variable to use as id, to control the page was started from the application. I have no control over what parameters are sent from the application).
My problem is, that even though the redirect work fine, I am transfered to the other page, the initial URL is still showing in the address-field, and that is really what I try to avoid.
Anyone have an idea what to do? I'd really appreciate it

Reply With Quote
  #2 (permalink)  
Old March 11th, 2006, 12:57 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii gorros!!
1>Change form method="get" to "post"
2>If you dont' want to show initial page ,redirect the page safely when page is loaded successfully
e.g.

i am accessing a page from page1.asp on form submission
"myfile.asp"?x=X1&y=Y1" <this is the result of method="get">
myfile.asp <when method is "post" field values will not appended in query string ,rather than passed it as http-header-body>

In case of you have no choice to change method=get to method="post"

1>first create a form with required values as hidden with method as post
2>on page load ,submit the form with your newpage.asp whtever.

Note:-if you are accessing the page while clicking on the link.
use javascriipt function ,with form method=post and submit the form.

Hope this will help you


Cheers :)

vinod
Reply With Quote
  #3 (permalink)  
Old March 11th, 2006, 05:08 AM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, the problem is that the initial page is initiated from an application, and I have no control over that application. the parameteres are passed as I wrote (...?x1=x&x2=y...), and they will show up in the address-field.
What I would like is to, in the first page, pass these input parameters (that I can access through GET) into SESSION-parameters and then imediatly make a redirect into another page.
The redirect work fine, but in the address-field it still show the path and address to the initial page, not to the page I redirect to. I have tried location.href, location.replace and I don't know what. Every time, I am transfered to the new page, but the initial address is still displayed

Reply With Quote
  #4 (permalink)  
Old March 11th, 2006, 05:24 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii gorros!!
No probs, let together we try to solve it!!

say you are accessing
http://localhost//myfolder/mypage.asp?x=X&y=Y"


now in mypage.asp write following code

<body onload="submitRedirect()">
<form name="tempform" method="post" action="newpage.asp">
<input type=hidden name=x value="<%=request("x")%>">
<input type=hidden name=y value="<%=request("y")%>">
</form>
<script>
function submitRedirect()
{
document.tempform.submit();
}
</script>

Hope this will help you
I am online on vinod_yadav1919@yahoo.com





Cheers :)

vinod
Reply With Quote
  #5 (permalink)  
Old March 11th, 2006, 07:37 AM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi vinod, did you get my mail? And by the way, thank's a lot for helping

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UPDATETEXT Problem: replace one value with another kwilliams SQL Server 2000 0 November 5th, 2007 12:04 PM
problem with redirect.. joeore PHP Databases 2 February 17th, 2004 02:54 PM
Replace problem neo_jakey Classic ASP Basics 2 January 8th, 2004 10:00 AM
repsponse.redirect problem skipinator ASP.NET 1.0 and 1.1 Basics 3 June 8th, 2003 02:02 PM



All times are GMT -4. The time now is 08:48 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.