#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Location
    Sydney, Australia
    Posts
    5
    Rep Power
    0
    I am curious to know if it is possible to prevent a page from refreshing and thus requerying a database.
    For example:
    Let's say I have a list of emails, clicking on the subject opens the email, once I have read the email I hit the back button, but I don't want a requery just yet.

    How can I prevent the requery, any ideas?

    Thanks in advance
    Graham
  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,646
    Rep Power
    4492
    If you're just hitting the back button, it should show the page from the cache and not do a query and recreate the page. If you clicking a link to go back, then you will have to do a query in order to reconstruct the page.

    Am I making any sense??

    ---John Holmes...
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Location
    Sydney, Australia
    Posts
    5
    Rep Power
    0
    Thanks John that's good to know.

    I have one further question that is somewhat related.

    I have search page the is called by a drop-down list box values from the list box are passed to the search page which then displays the results.
    I click a link on the results page and view the article. I then hit the back button on my browser to go back to the result list.
    Based on your previous comment I should get the cached results page. What I get is:

    "Warning: Page has Expired
    The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.

    To resubmit your information and view this Web page, click the Refresh button."

    What can I do to prevent this happening?

    Thanks again.
    Graham
  6. #4
  7. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,646
    Rep Power
    4492
    This is something that's come up on here a few times, also. It's an issue with the security setting in your browser. If you have the security set on high, then it will not show the pages for "security reasons". I've only heard about this issue happening on IE...Netscape shows it no problem from what I've seen.

    Hope that helps.

    ---John Holmes...
  8. #5
  9. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Location
    Sydney, Australia
    Posts
    5
    Rep Power
    0
    Thanks John.
    Not sure that's the problem though.
    With IE security turned off it still happens. The quest continues

    Thanks again.
    Graham
  10. #6
  11. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,646
    Rep Power
    4492
    I'm still sure it's a browser issue, though. Maybe it's something you can't turn on and off. Maybe there are some headers you can use to make the browser cache the page?

    ---John Holmes...
  12. #7
  13. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Location
    Sydney, Australia
    Posts
    5
    Rep Power
    0
    Yes I think you are right.
    Although it appears the page is being cached.
    Some extra header stuff might do the trick, now where is my webmaster in a nutshell book...
  14. #8
  15. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Location
    Sydney, Australia
    Posts
    5
    Rep Power
    0
    Ok I am making progress I think.
    According to my trusty book I need to use GET in my form instead of POST.
    Now get this (pardon the pun). When I use GET the URL gets trashed.
    With a post it was like this
    search.php?var1=h&var2=0&var3=a
    with a GET it comes out like this:
    search.php?a=0&x=19&y=14

    var1 and 2 are gone, the value of var3 becomes a variable with a value of 0 and there are 2 new vars, thing is I don't have any variables in my form named x and/or y.

    The mystery continues...

    Graham


    [This message has been edited by grahamg (edited October 19, 2000).]
  16. #9
  17. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Location
    Sydney, Australia
    Posts
    5
    Rep Power
    0
    OK got it working with GET.
    Problem solved!!!

    The form orginally had a POST method and the following action="/search.php?var1=h&var2=0&var3=a"
    I changed the action to action="/search.php"
    and added the following hidden form input fields: var1, var2, var3
    The search now works, I can browse an item in the result list and hit the back button and return to the result list.
    Funny thing is I am still getting those mystery x and y variables in the url...

    They can wait I am off to bed for some well earned sleep

    Graham
  18. #10
  19. No Profile Picture
    The Dude Abides
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Feb 2000
    Location
    grass valley,ca
    Posts
    1,062
    Rep Power
    16
    The x and y variables appear when you are using an image as your "submit" button.
  20. #11
  21. No Profile Picture
    The Dude Abides
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Feb 2000
    Location
    grass valley,ca
    Posts
    1,062
    Rep Power
    16
    The x and y variables appear when you are using an image as your "submit" button.
  22. #12
  23. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Location
    Sydney, Australia
    Posts
    5
    Rep Power
    0
    Thanks x 2

    Graham

Similar Threads

  1. Replies: 1
    Last Post: February 2nd, 2004, 12:51 PM
  2. Refresh returns page to same location
    By RobMn in forum HTML Programming
    Replies: 1
    Last Post: January 26th, 2004, 01:54 PM
  3. passing the url from HTML page to a php
    By lordorkus in forum PHP Development
    Replies: 10
    Last Post: January 20th, 2004, 06:36 PM
  4. auto refresh page within milliseconds?
    By atifriaz in forum ASP Programming
    Replies: 1
    Last Post: January 14th, 2004, 02:58 PM
  5. refresh main page and iframe from iframe
    By isloke in forum HTML Programming
    Replies: 2
    Last Post: January 10th, 2004, 01:15 PM

IMN logo majestic logo threadwatch logo seochat tools logo