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 #169861 is a reply to message #169841] Tue, 28 September 2010 20:11 Go to previous messageGo to previous message
Kentor is currently offline  Kentor
Messages: 5
Registered: September 2010
Karma:
Junior Member
On Sep 28, 1:10 am, "J.O. Aho" <u...@example.net> wrote:
> 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

I guess you're right. Using a session would be the best way. Thanks!
[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: Tue Feb 18 23:40:13 GMT 2025

Total time taken to generate the page: 0.05363 seconds