Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
September 28, 2010, 4:34 am
rate this thread
I'm running a query in initialFile.php which then displays some
information on the page. Later, the user has the option of clicking on
a load button, which loads a map to display this information on a
initialFile.php has a query (that I need sometime later) and this page
makes an AJAX call to another file ajaxFile.php (where I need the
query so I can run it again).
I don't want the user to be able to see the query through cookies or
anything unsafe for the site.
My question is the following, is there a way to create a global
variable in initialFile.php and then access it in ajaxFile.php ? If
so, how would I do it? I have tried and failed using several options.
Is it better to just use a session to pass that query?
Would you have any better ways of doing this?
Thank you so much!
Re: global var vs session vs something else maybe?
Then use session, user will at most see the session key, no clue what values
may be stored.
I wouldn't really store the whole query in the session, but only the values to
be used in the query, that way you can do more with the values, like display
$_SESSION is the closes thing, you could store it on a file which you create
with the script, but that's kind of reinventing the wheel.
- » How to match image file names under a directory with glob()
- — Next thread in » PHP Scripting Forum