Forum Moderators: coopster

Message Too Old, No Replies

bypass page expired

any ideas?

         

Scally_Ally

2:32 pm on May 9, 2007 (gmt 0)

10+ Year Member



Hi all,
Just wondering if anyone has any ways of getting round the page expiring when you post variables to other pages.

You know the deal, in IE it is really ugly, it just says "Page Expired". And its not that much better in FF cause it alerts that you are reposting vars etc etc.

I have got round it a couple of ways.
1. use modrewrite so that the necessary vars are passed using get vars
2. post the form to itself and then use header("location") to redirect somewhere else.

On this particular project i cant use mod rewrite because some of the vars are too long and a fair few of them are arrays.
I also find the second option very tedious as it means posting alot more vars around the site.

Just curious if anyone has any other ways of doing it?

Cheers
Ally

jatar_k

2:36 pm on May 9, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



maybe you can explain the "why" of it to me.

This is a necessary functionality of browsers and getting around it doesn't make much sense to me.

what functionality are you having issues with?

the only time this should be an issue is if the user hits the back button to go back to a form they have alreay submitted. In that case the browser should notify them.

Scally_Ally

2:57 pm on May 9, 2007 (gmt 0)

10+ Year Member



Hi Jatar,
I just think it looks really ugly to be honest, and i think that when a client looks at it, and they press the back button they think that something is wrong with the site (no matter how many times you tell them..)

The form i have needs to take alot of variables over 3 different screens, each screen has its own individual purpose and the way i am doing it at the mo is to submit to itself with a variable saying what the next step is, and using this var to decide what needs to be processed and showing relevant template. I am storing each process (page) set of results in a db.

I am not having any probs with the functionality of the site or passing of vars etc, it all works fine, I have even added a back button for the user on the site but the user can still just press the back button on the browser and this message will show up.

[edited by: Scally_Ally at 2:59 pm (utc) on May 9, 2007]

jatar_k

3:16 pm on May 9, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



part of it is explaining to the client that browsers work that way. Yes, I know, I've had those conversations too, but at some point they have to accept certain things.

The way top do it is to have your processing script in the background and obviously save the vars to a session as you go. This way each form page never had anything posted to it.

it's actually the logic (I would say lack there of as I hate things posting to themselves for many reasons, please take no offense as none is intended) of posting to itself is what is causing the browser to be upset, the behaviour oif asking to repost is required and desired.

Scally_Ally

4:10 pm on May 9, 2007 (gmt 0)

10+ Year Member



yeah, my prob is that when the user presses back they want to go to a page that had already had vars posted to them (every page i have involves posting some vaiables to the next page, so no page is purely 'static')..

Looks like that is just the way it is with this project, guess i am just gonna have brush up on my client relationship skills instead..

Thanks for your thoughts on the subject jatar.

Ally

jatar_k

5:28 pm on May 9, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



on the page, check for those vars in the session, if they're there, then echo them in the form. If they hit back then they would already have those sessions from previous pages in the session. Easy enough to just echo them.

<added>so now you explain it to the client, say it just is that way, then give the big, it's going to be tough but I'll see what I can do.

Then make it happen and belabour it a bit ;)