[UPHPU] php and javascript menu
John
lists at strictlyrockymountain.com
Sat Aug 27 16:48:54 MDT 2005
>
> Your Javascript can't _directly_ set a php variable, like for a session,
> but there are some ways around that, and yes, they're related to the
> AJAX stuff in a way.
>
> I definitely agree that sessions are the way to go if you can get it,
> because then you only have to worry about getting a cookie set once, and
> then you're fine.
>
> The trick I would try if it were me would be to use the Javascript to
> trigger a hit to the server, to a php script that would update the
> session variables. You could do that in several ways. Using an image
> src would be an easy way, like you would do for preloading. Another way
> would be with an iframe or something, I bet, but I've never used
> iframes personally. The other way (related to AJAX) is to use an
> XML-HTTP request to hit the server. In any case, you just send some get
> variables in the URL to pass whatever you need back to the server (or
> with XML-HTTP, you can do POST instead of GET if you want).
>
> You might consider contributing the patches to the GPL'd menu thingy
> back to the author, after you get it working, or if he doesn't want
> them, you can just post them publicly in case anyone else is having the
> same problem you are.
>
> Good luck!
>
> Mac
Thanks Mac, those are good suggestions and I'll work on them. If I do
find a good work around I'll definitely tell the author. However he
hasn't responded - only a few days now - to my first email. So he may not
be interested. But I'll play that card if I get a good solution.
Thanks again.
More information about the UPHPU
mailing list