hiding the parameters in the address bar
i want to hide the parameters i send to the server
in the address bar ( by the get method)
how can i do it?
my web is written on asp pages
waiting to your help, mikalush
![]()
i want to hide the parameters i send to the server
in the address bar ( by the get method)
how can i do it?
my web is written on asp pages
waiting to your help, mikalush
![]()
Hi mikalush,
To keep the user from seeing your query parameters in the URL address bar, use the POST method to sumbit your form data to the web server, not the GET method.
Oh, you should also be aware that the earlier suggestion to use location to hide the address bar (presumably using window.open) will be problematic in the future. As of IE7, location affects the navigation bar. The address bar is always displayed, as a precaution against phishing attacks and other naughtiness. For more information, please see Why Does IE Resize My Dialogs? (granted, it's actually about something else, but it discusses some of the reasoning behind the change).
Hope this helps...
-- Lance
thanks everybody !!
i can't use the property "location=no" because i want the user to see the address of the website, i just don't want him to see the parameters i send,
for ex:
www.mySite.com/index.asp?prm1=3&prm2=ddd
i want the use user will see : www.mySite.com/index.asp
and will not see: prm1=3&prm2=ddd.
and i don't think i can use the post method, because the users are entering my pages from a lot of links and i must send in each link the special parameters for him, so the pagess will know what to do..
(imagine that i have 30 links in my home page, to the same page, each link with different parameters, i think the best way is by the get method,
don't think so?
so i ask again for a way to hide the parameters using the get method.
thanks a lot ![]()
Mikalush,
>> so i ask again for a way to hide the parameters using the get method.
No; that's the main difference between GET and POST; GET tacks the query parameters onto the URL and POST submits them separately.
Either method will submit the query parameters to the CGI server, so switching the method should not have much of an impact on the avilability of query variables to the server process that responds to your CGI query.
In fact, you may find that POST provides more flexibility, as many servers are configured to limit the number of characters that can be passed to a process. In addition, POST keeps your query parameter values out of many server logs.
Hope this helps...
-- Lance
thanks,
i read something about mode_rewite,
but i need to learn it more...
the problem with post method is that in some browsers, you can see the parameters..
is anyone know how can i send in post method when i don't have a form, just a lot of links, in one page, every link to is to the same page but it make the page to be view in differnert posoition (according to the parameters).
hope you understand what i mean..
mikalush
![]()
There are several ways that you can go about hiding the parameters being passed throughout your site. Depending on your level of expertise you can get quite creative. Keep in mind that many of these techniques can have a negative impact in certain browsers and/or require large amounts of times to deploy. You are probably going to go with the Dynamic Form Submission as it is the 'cleanest' method listed.
1. Cookie Navigation
You can have each link execute a javascript function that
assigns needed parameters to cookies and navigates the browser to next page.
2. Dynamic Form Submission (Link Style)
- Place a FORM element on your page and assign an ID to it
- Each link on your page will need to execute a javascript function that changes
the form's ACTION attribute to the desired destination, dynamically creates hidden INPUT elements, and then submits the form.
3. Frameset Masking
The oldest trick in the book, just place your page inside a frame and use
javascript functions to handle user navigation to prevent info from being seen in the
status bar
4. AJAX driven navigation
By far the hardest method listed, parameters are passed to your server
via AJAX where they are saved and attributed to the user's session.
When user reaches next page, the server generates page based on parameters.
5. SCRIPT driven navigation
Virtually identical to AJAX DN but compatible with more browsers.
Method dynamically creates a SCRIPT element and assigns a 'manager' script location
to the 'SRC' attribute. The user's parameters are tagged on in the query string of the SRC attribute and saved on your server for use in generating the next page.