Link to home
Start Free TrialLog in
Avatar of vmanocha
vmanocha

asked on

controlling browser's history/back button/cache

I have a CGI application. Suppose the URL for that is:http://myserver/cgi-bin/foo.exe?ID=1I put this as a link in my startup page. SO when a user clicks this link, I generate a page which is returned back to the user. Now I want the following to happen:The URL shown to the user should be http://myserver/cgi-bin/foo.exe
  (no ID is to be shown)Now the page that I generated has another link to:http://myserver/cgi-bin/foo.exe?ID=2On clicking this link, I generate another page. Again I would like to display the URL to the user as:http://myserver/cgi-bin/foo.exe (again no ID is shown)And also if the user uses the 'BACK' button to go back to the previous page, he/she should not be able to go back tothe earlier page generated. The user should get back to the startup page.So basically what I want to do is havd a startup page. From there on I would generate pages, each of which will have next and previous links to go back and forward. But if the user uses teh browser's 'BACK' button, the user should go straight back to the startup page.
I would appreciate if someone can provide me with the html tags i would need to generate from my CGI script for this to happen.thanks.
ASKER CERTIFIED SOLUTION
Avatar of mrmick
mrmick

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vmanocha
vmanocha

ASKER

This is not what i am looking for. Let me clarify my question.Let's say i have the following link in the start page:<A HREF="http://myserver/cgi-bin/foo.exe?ID=1">CGIPage</A>So when the user clicks on CGIPage, foo.exe gets executed and it generates a page which is then displayed back to the user. Now in the browser window, there is an Address field which will display:http://myserver/cgi-bin/foo.exe?ID=1Instead of the above, can i make it display:http://myserver/cgi-bin/foo.exe---And yes, i have many questions here, but i feel that they are all related. anyway, i am increasing the points for this question from 50 to 100 !!!
This is not what i am looking for. Let me clarify my question.Let's say i have the following link in the start page:<A HREF="http://myserver/cgi-bin/foo.exe?ID=1">CGIPage</A>So when the user clicks on CGIPage, foo.exe gets executed and it generates a page which is then displayed back to the user. Now in the browser window, there is an Address field which will display:http://myserver/cgi-bin/foo.exe?ID=1Instead of the above, can i make it display:http://myserver/cgi-bin/foo.exe---And yes, i have many questions here, but i feel that they are all related. anyway, i am increasing the points for this question from 50 to 100 !!!
I see. (said the blind man)

I don't think what you want is possible through the use of an anchor tag, however I think you can get exactly what you want using a form tag, for example:

<FORM ACTION="http://myserver/cgi-bin/foo.exe" METHOD="POST"> (do not use the GET method here as it would produce the same affect you're trying to avoid)

Inside the form use a submit button, for example:

<INPUT TYPE="SUBMIT" NAME="ID1" VALUE="Opt1_ButtonCaption">
<INPUT TYPE="SUBMIT" NAME="ID2" VALUE="Opt2_ButtonCaption">

</FORM> (close the form tag)

This may be the answer to both your questions because the displayed URL is the URL as it appears in the ACTION reference above.  So, "backs" clicked to the same URL will produce no change (or skip to the last different URL)

Hope this helps, mrmick

i am not sure whether i can use a FORM. actually i am using images as links. when i use the type="submit", it will create a button. is there any way to use image instead ?
I don't think so using straight HTML.  Perhaps an Active X component would do the trick, although I stick to straight html and server side scripting only because I like my stuff to work with any browser.

Good luck, mrmick
thanks for your help. i was able to achieve what i wanted, usingthe combination of what you had suggested and JavaScript.
Great!  what's the url so I can check out what your doing?