FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » global var vs session vs something else maybe?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: global var vs session vs something else maybe? [message #169841 is a reply to message #169840] Tue, 28 September 2010 05:10 Go to previous messageGo to previous message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma:
Senior Member
Kentor wrote:
> Hello,
>
> 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
> Google map.
>
> initialFile.php has a query (that I need sometime later) and this page
> has a button which runs a javascript function in loadMap.js which
> 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.

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
them or...

> My question is the following, is there a way to create a global
> variable in initialFile.php and then access it in ajaxFile.php ?

$_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.



--

//Aho
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to match image file names under a directory with glob()
Next Topic: PHP manual note
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 04:05:18 GMT 2024

Total time taken to generate the page: 0.04935 seconds