Re: [PHP] Passing variables between pages



tedd wrote:
At 12:42 PM -0400 9/19/08, Dan Joseph wrote:
On Fri, Sep 19, 2008 at 12:35 PM, tedd <tedd.sperling@xxxxxxxxx> wrote:

At 12:22 PM -0400 9/19/08, Jason Pruim wrote:

It's interesting that another topic (i.e. [PHP] SESSIONS vs. MySQL) is
discussing the differences in storing variables in SESSIONS as compared to
> storing them in MySQL when using this technique would not require either.


You've definitely raised an interesting topic.

Question though... a system requires different levels of access to see
various parts of the system. How does your method of doing things w/o
sessions accomidate that? Does it use that information from the origin
POST? Also, is this secure? Any loop holes?

I don't see any loop holes and it's secure as any other php script.

The technique holds all variables intact, including POST, GET, SESSION, et all arrays.

This does work -- as shown by this:

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

Here's another example:

http://www.webbytedd.com/bb/php-run-php/

Note that $test is defined and populated with "This is a test" at the start of the parent script -- however, the contents of the variable remain regardless of which script you choose.

Cheers,

tedd


sorry to wade in on this one but it seem's like a bit of false logic to me; and isn't actually doing anything different than standard php functionality. (includes always have access to get/post/session/server and variables defined before the script was included)

For years people have simply ran a whole website through a single index.php and called the modules via include (the whole ?mod=contact era)

This is exactly the same; you don't need $_SESSION's in this case because all you're doing is POST'ing the data every time..

from the source of you're demo:
"<input type='hidden' name='var2' value='This is another string here'>
<p>
<input type=submit value='Click to Continue"'>
</p>
"

Thus all we are talking about is replacing session with multiple posts to carry the data; which is a nightmare; shows up awful messages if a user clicks back in IE and asks the user to resend data in firefox where obviously they'll be like er what data did I send :o

Am I missing something here..?

Regards and no ill-intention meant.

Nathan
.



Relevant Pages

  • Re: PHP strangeness
    ... > sessions turned off. ... Whoever can use PHP without ... interest for you: mySQL and session. ... Posted through www.w00tlinux.com/bb - free access to Linux newsgroups. ...
    (alt.os.linux.suse)
  • Re: [PHP] Passing variables between pages
    ... It's interesting that another topic (i.e. [PHP] SESSIONS vs. MySQL) is ... discussing the differences in storing variables in SESSIONS as compared to ... storing them in MySQL when using this technique would not require either. ...
    (php.general)
  • Re: PHP strangeness
    ... > sessions turned off. ... Whoever can use PHP without ... interest for you: mySQL and session. ... this advise in case somebody else needs the trick. ...
    (alt.os.linux.suse)
  • Re: Reducing load for LAMP app?
    ... with PHP and MySQL to know the details. ... MySQL has a query cache. ... asking about the sessions. ...
    (comp.lang.php)
  • Tomcat sessions memory usage and MySQL connections
    ... experiencing freezing of the web server (java or mysql processes take ... now mysql seems to have too many connections all the time. ... On the other side, tomcat seems to have a lot of unused sessions open, ...
    (comp.lang.java.programmer)