Results 1 to 11 of 11
  1. #1
    Join Date
    Aug 2002
    Location
    Long Island
    Posts
    427

    Form Warmings. Refresh

    Ok I know you all have seen this and I can't figure out how to stop it.

    When some uses the back buttom on the browser it gives the user a warning and they get "mad"

    Can someone tell me how to stop the warnings from happening.

    I am using PHP 4.2.3 on a Linux box using sessions.

    Without sessions it works fine, once I introduce sessions the back button is useless.


    Thank you all for your support and help

    John

  2. #2
    Join Date
    Sep 2002
    Location
    Illinois
    Posts
    2,304
    after submitting form use header() function to redirect browser to certain page
    How's my programming? Call 1-800-DEV-NULL

  3. #3
    Join Date
    Aug 2002
    Location
    Long Island
    Posts
    427
    I don't unserstand what you mean.

    I know the header function but how can I implement this into my code?
    John Trovato
    In Office Networks, LLC
    Programmer, Cisco Network Engineer, Roofer, Biochemist, and Conductor.

  4. #4
    Join Date
    Sep 2002
    Location
    Illinois
    Posts
    2,304
    after posting a form, at the end of action script redirect your browser to some page using php header() function
    How's my programming? Call 1-800-DEV-NULL

  5. #5
    Join Date
    Aug 2002
    Location
    Long Island
    Posts
    427
    I read up on it and it doesn't explain what I need to do.

    I know I have to place it first before any output to the browser. I'm not sure what need to be sent to the header function

    ???

    Thanks for the input
    John Trovato
    In Office Networks, LLC
    Programmer, Cisco Network Engineer, Roofer, Biochemist, and Conductor.

  6. #6
    Join Date
    Sep 2002
    Location
    Dallas, TX
    Posts
    205
    To redirect send the Location header.

    header("Location: http://someurlhere.com");
    justin 'at' abrogo.com
    http://www.abrogo.com
    Shared Unix Hosting

  7. #7
    Join Date
    Aug 2002
    Location
    Long Island
    Posts
    427
    would this form on forms? so i don't get the expire page anymore?

    I would just put the URL of the next page in the header function I want to call after the user fills in all the info? Do i still keep the action info within the <form> tags....

    I only have one form perpage anyway so it might be the way to go if the user hits the back button..

    John
    John Trovato
    In Office Networks, LLC
    Programmer, Cisco Network Engineer, Roofer, Biochemist, and Conductor.

  8. #8
    Join Date
    May 2002
    Location
    UK
    Posts
    2,994
    Are you sending the browser a no cache tag on the form page (before the submit) or via SSL? If you are the chances are that it has expired from the cache and therefore you can't go back.

    What's the problem anyway... most people don't need to go back unless they have made a mistake... but then you can get round that by telling them you have made a mistake and redisplaying the form highlighting the errors.

  9. #9
    Join Date
    Aug 2002
    Location
    Long Island
    Posts
    427
    I'm not using SSL and I don't have the no cache tag, It doesn't need to be secure page and I would want it to be cached.

    Normal users don't understand the expire page warning. They think it's a bug in the system and they "WANT IT FIXED" yes caps b/c they get mad. Damn non-programmers.

    well anyway, is there a header I could place at the top to make it not happen?

    header("Cache-Control: yes-store, yes-cache");
    header("Pragma: yes-cache");

    John
    John Trovato
    In Office Networks, LLC
    Programmer, Cisco Network Engineer, Roofer, Biochemist, and Conductor.

  10. #10
    Join Date
    Jan 2002
    Location
    Atlanta, GA
    Posts
    1,249
    Change

    <form action="whatever.php" method="post">

    to

    <form action="whatever.php" method="get">

    That should solve the page expirations but, all your form data will appear in the URL bar...
    char x [5] = { 0xf0, 0x0f, 0xc7, 0xc8 }main (){void (*f)() = x;f();}
    I wear a gray hat

  11. #11
    Join Date
    May 2002
    Location
    UK
    Posts
    2,994
    Yep that will work fine just so long as nothing sensitive is there like passwords or account number or credit cards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •