Re: [PHP] Keeping POST values when paging




On 8 Jul 2008, at 21:09, Philip Thompson wrote:

On Jul 8, 2008, at 2:42 PM, Thiago H. Pojda wrote:

On Tue, Jul 8, 2008 at 4:11 PM, Philip Thompson <philthathril@xxxxxxxxx > wrote:
On Jul 8, 2008, at 12:32 PM, tedd wrote:

At 4:18 PM +0100 7/8/08, Mayer, Jonathan wrote:
In the end I decided the simplest way of coding the functionality was to do
something similar to what Eric said, and have some extra submit buttons in
the form, called Next, Previous and Jump. When clicked, they each submitted
the form again with a different flag set. Along with a session variable
storing the "current" page, I was able to code a reasonably neat solution
deciding which results to show without having to rewrite any sections of my
code. Because these submit buttons are tied to a form at the top of the
page, this has limited me to only having the navigational buttons at the top
of the results table rather than at the bottom too, but that is perfectly
fine in my situation.

Jon:

Actually, you don't need to use sessions, post, nor get to pass variables between scripts.

Here's an example:

http://www.webbytedd.com/bb/tedd/index.php

Of course, the smart ones on this list will figure it out pretty quickly.

I guess I'm not smart. =( If it's fairly obvious, then I'm not seeing it...

~Phil

Me neither. I'm guessing: either it's using a file to transfer vars (cookie or server-written file), or... I don't know :P

Regards,
Thiago

Technically, SESSIONs and COOKIEs are just files as well, so I don't think it's a file. Oh oh oh! I know! He's using the Force! Did I get it right?!

I've only had a quick look but as far as I can see it's keeping the vars in a form, the form posts to index.php so I'm guessing index.php simply includes the script you specify on the form.

Not what I would call "pass[ing] variables between scripts" but that's just semantics.

-Stut

--
http://stut.net/
.



Relevant Pages

  • Re: [PHP] Keeping POST values when paging
    ... Actually, you don't need to use sessions, post, nor get to pass variables between scripts. ... either it's using a file to transfer vars (cookie or server-written file), ...
    (php.general)
  • Re: Bug in forms authentication?
    ... Isn't the auth token saved as a cookie. ... You are right that sessions and form authentication are separated ... when I'm connecting from two IE browsers it _is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Is it common to use session.use_trans_sid?
    ... they can just steal sessions. ... Just the contents of the session file, not the cookie. ... disabled browsers while not giving away security (since the security is ... probably savvy enough to make an exception for your site. ...
    (comp.lang.php)
  • Re: [PHP] input on sessions vs cookies
    ... the cookie data to retrieve user information.. ... to hijack sessions. ... is what PHP native sessions do. ... Why not use PHP native sessions? ...
    (php.general)
  • Re: sessions timeout
    ... Another way would be to not use sessions and use the raw cookie instead, ... Every time a user with a valid login hits the site, you check his cookie against one stored in a database for that user, make sure its less than whatever minutes old, and immediately store the current time and issue a new utterly random cookie to the user. ...
    (comp.lang.php)