[thelist] RE: web-app in php (was: no subject by Andrew Embler)

David Kutcher david_kutcher at hotmail.com
Sat Aug 24 12:44:01 CDT 2002


Andrew,

Lets assume the app works like this:

User logs in
Sees their calender
Adds a new item
Sees their calender with new item

Basically, this is the way you would want it to work:

1) when user logs in, start a session and add their id into the session
2) the calender page takes the id from the session, uses that id to pull the
items in the db for the calender
3) the user selects to modify an item in the calender or to add a new item
(which changes to page "add/modify"
4) they submit to a submission page where it adds, modifies, or deletes the
info into the db
5) on successfully submitting the info, the page is redirected to the index
page which loads the items based on the id in the session (#1)

Now, if you were good, you would make this all one php page with a switch
based on the $action and have it reload $self (I believe that's the var).
With this, there is no resubmission error or timeout (beyond the session
timeout) that you can specify in most cases

David
www.confluentforms.com



> Date: Fri, 23 Aug 2002 16:54:55 -0700
> To: thelist at lists.evolt.org
> From: "Andrew Embler (ML)" <lists at electricstate.com>
> Subject: [thelist] (no subject)
>
> Hello all,
> I'm creaing a web-app in PHP. Let's say its a Calendar. This is the
problem
> I'm having, and what makes it worse is that it's the way that the browser
> is supposed to behave, but at this point I wish it weren't:
>
> * User adds an item to his/her calendar, (through a form, clicks "Save",
> form submits, etc...)
> * User then sees the Calendar view, w/new item present.
> * User clicks on another navigation link (e.g.: User heads to the
> "Projects" page.)
> * User tries to use the back button on his/her browser, but then gets the
> following warning:
>
> Internet Explorer: "The page cannot be refreshed without re-sending the
> information." Or worse: simply a blank page loads with the words "Page has
> Expired"
>
> Mozilla: "The page you're trying to view contains POSTDATA."
>
> IF the user hits Cancel, he/she gets nowhere. If the user hits "Retry/Ok"
> he/she adds another of the same items to the page - ie: the first query is
> re-posted to the page, resulting in an annoying duplicate.
>
> What I want to do is this: I want the initial form to post the additional
> information, the php script to process it, and then the page to reload.
> However, at that point, I want the page to think it hasn't been generated
> by a post. Any way to do this?
>
> Andrew



More information about the thelist mailing list