search engine ASP script - GET vs POST

K

Kevin Blount

I love Google groups, you can find answers to ALL your questions here..
right? :)

I'm building a search script in ASP (not progressed to ASP.NET just
yet) and everything works. The problem I was having though was when
users move through the different pages of a set of returned results,
and then pres the browser "Back" button, they saw the "Warning: Page
has Expired" message, and had to refresh.

I fixed this by changing my form from POST to GET and now users can go
back through their browsers history and see previous pages of results.

But, and you know what's coming, GET is fugly!! I don't want all that
garbage in my URL, spoiling a nice pretty website. So, here's the
question (though I suspect I know the answer <frown>):

Is there a way to use GET but still POST the form entries? or maybe use
POST but append 1 item to the URL?

I wondering if using a temp (i.e. without an expiry date) cookie could
contain most of the info, such as search string, scope, language, etc,
and just keeping page=X in the URL. That I could live with and stick
with GET. but if I can get rid of ALL pairs from the URL, and/or go
back to using POST without the "Warning: Page has Expired" message,
then that would be ideal!

any thoughts, hints, links, etc would be most appreciated.

Kevin
 
B

Bob Barrows [MVP]

Kevin said:
I love Google groups, you can find answers to ALL your questions
here.. right? :)

I'm building a search script in ASP (not progressed to ASP.NET just
yet) and everything works. The problem I was having though was when
users move through the different pages of a set of returned results,
and then pres the browser "Back" button, they saw the "Warning: Page
has Expired" message, and had to refresh.

I fixed this by changing my form from POST to GET and now users can go
back through their browsers history and see previous pages of results.

But, and you know what's coming, GET is fugly!! I don't want all that
garbage in my URL, spoiling a nice pretty website. So, here's the
question (though I suspect I know the answer <frown>):

Is there a way to use GET but still POST the form entries? or maybe
use POST but append 1 item to the URL?

I wondering if using a temp (i.e. without an expiry date) cookie could
contain most of the info, such as search string, scope, language, etc,
and just keeping page=X in the URL. That I could live with and stick
with GET. but if I can get rid of ALL pairs from the URL, and/or go
back to using POST without the "Warning: Page has Expired" message,
then that would be ideal!

any thoughts, hints, links, etc would be most appreciated.

Kevin

You can use client-side code to modify your form's action attribute, adding
querystring values to it, regardless of what your form's method is. Please
follow up in a client-side scripting newsgroup, such as .scripting.jscript.

Bob Barrows
 
K

Kevin Blount

Bob, your message is a tease :D can you be more specific here, in this
newsgroup, otherwise the information you've given isn't enough for me
to pose the new question in script.jscript (shudder), as per your
"instruction".
 
J

Jeff Cochran

Bob, your message is a tease :D can you be more specific here, in this
newsgroup, otherwise the information you've given isn't enough for me
to pose the new question in script.jscript (shudder), as per your
"instruction".

Modify the form information returned by the client for the page, so
that your page receives the form information back when you reload the
page. The actual coding is client-side, basically simple HTML, so not
on topic here and better results would be had in a client-side group.

Basically, server-side on a new submission the form is blank. On a
return, the fields are populated in the form so that information gets
sent to the server, which then reads the values with the Request.Form
method and populates the form for resubmission. Usually a hidden
field is used to check if this is the first submission, and if not,
read the values and populate the form.

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top