Bluehost.com Web Hosting $6.95

Advice: GET vs. POST vs. SESSION

This is a discussion on Advice: GET vs. POST vs. SESSION within the PHP General forums, part of the PHP Programming Forums category; I was hoping that some of you would be able to give me some advice. I have started creating a ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-23-2003
Jed R. Brubaker
 
Posts: n/a
Default Advice: GET vs. POST vs. SESSION

I was hoping that some of you would be able to give me some advice.

I have started creating a web application that makes heavy use of URL GET
variables in order to solve a problem that I have had with POST in the
past - namely, having to refresh the document and repost the variables when
you use the browser's back button.

So I enthusiastically have embraced GET variables, but am now having a
struggle editing the URL variable string.

So this is my question: is using URL GET variables that best way to avoid
that browser back button effect?

I have thought about using session variable extensively, but that I am going
to have to be unsetting them all over the place.

So - anyone have any advice?
Thanks in advance!
Reply With Quote
  #2 (permalink)  
Old 11-23-2003
Robert Cummings
 
Posts: n/a
Default Re: [PHP] Advice: GET vs. POST vs. SESSION

On Sun, 2003-11-23 at 14:27, Jed R. Brubaker wrote:
> I was hoping that some of you would be able to give me some advice.
>
> I have started creating a web application that makes heavy use of URL GET
> variables in order to solve a problem that I have had with POST in the
> past - namely, having to refresh the document and repost the variables when
> you use the browser's back button.
>
> So I enthusiastically have embraced GET variables, but am now having a
> struggle editing the URL variable string.
>
> So this is my question: is using URL GET variables that best way to avoid
> that browser back button effect?


It can be a good way, but I believe the spec for GET based parameters
only guarantee processing of 1024 characters (this may be the wrong
number but there is a limit on the guarantee).

> I have thought about using session variable extensively, but that I am going
> to have to be unsetting them all over the place.


If you are worried about unsetting them all, maybe it would help to use
a two level array to hold your form data. Perhaps the following:

$_SESSION['formName']['email'] = $_POST[['email'];

Then when you want to clear the form you can do a simple:

unset( $_SESSION['formName'] );

HTH,
Rob.
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:36 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0