jade Posted April 22, 2008 Share Posted April 22, 2008 Hello, I'm a js newbie so all help is appreciated. Suppose I had a site that sold wallets. I would want to use some js to dynamically change the wallet type (bifold, trifold, etc) , wallet color, and possibly other variables (im not really selling wallets, just an example). Currently I know how to make a call to the js function to dynamically change things based on user input. The function also currently "saves" the user variables by writing the variables onto a link that loads into a hidden iframe. The link serves as _GET vars, and I can simply store them as session vars within the referenced page. My question is if this practice is "common" and if its "good practice". And if anyone knows of a better way to store vars via js, do tell. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/102285-updating-sessions-via-hidden-iframes-good-or-bad/ Share on other sites More sharing options...
RichardRotterdam Posted April 24, 2008 Share Posted April 24, 2008 you dont need a iframe to do anthing like that try looking up ajax examples all you want to do is set a server session am i right? Quote Link to comment https://forums.phpfreaks.com/topic/102285-updating-sessions-via-hidden-iframes-good-or-bad/#findComment-526292 Share on other sites More sharing options...
jade Posted April 24, 2008 Author Share Posted April 24, 2008 Yes, I want to set, update, and show server session vars (php). Actually I am using some ajax framework found here: http://www.robertnyman.com/ask/ The problem is , within the ajax calls, I am unable to reference, display, or alter any session data whatsoever. I assumed I would be able to use ajax to run a .php page that simply had "session_start();" in it and gain access that way. But it simply does not display the session data. I am a js newbie, so I may be in over my head here, but after some research, I think it has something to do with "race conditions". something like this: http://www.chipmunkninja.com/g@ and another guy with the same problem http://codeigniter.com/forums/viewthread/76343/ So now I just use the iframe to edit and store my session vars, but actually that still does not allow me to display any session vars within a page being run via an ajax request. They will only show when I reload a fresh page. Quote Link to comment https://forums.phpfreaks.com/topic/102285-updating-sessions-via-hidden-iframes-good-or-bad/#findComment-526435 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.