I want to declare a variable that is global that I can use (and modify) all over my website.
It is a simple HTML textbox that I use when I click a "button" (it is designed to look like a button) and when I click it, I execute a Javascript function and that is where I also want to create/modify and store the variable which is the value in the HTML textbox
My main problem lies that Im trying to create a client side languge based (JS) global variable and then trying to access in server side language based (PHP) pages. I have to be able to access it from other JS, PHP, PHTML, HTML, etc. pages.
A cookie comes to mind but I tried "document.cookie" and it doesnt work; I suppose that it only applies to the CURRENT document at hand. The other option Ive read about is using Ajax but I have no idea how to do it and for ONE thing I perfer another solution almost :)
No. Windows 8 had little to no spywhare, is actually faster than 7 but it has the dreaded start screen, nothing that you could not fix with start8. Windows ME crashed often, but was shotlived and replaced by XP, which is a much better windows in itself.
Windows 8 was uninspiring but it was fine / worked. It was just overshadowed by how great Windows 7 was. Windows ME seem to be just unstable for most people - I was using Windows 2000, which was far superior. The two best versions are Windows 7 and 2000
I don't think ME was that bad. The stability issues were mostly caused by drivers. This was when the switch from vxd to wdm was happening. The other complaint was not being able to shut down into DOS anymore which was silly with XP right around the corner.
As much as I hated Windows 8, although I never used it personally on any of my own machines, I think Windows Me was hands down the worst OS from MS.
I have Windows 11 on 2 unsupported machines and haven't had any issues and I actually kind of like it. Still hate how slow Windows updates are though.
Question
htcz
Hey
I want to declare a variable that is global that I can use (and modify) all over my website.
It is a simple HTML textbox that I use when I click a "button" (it is designed to look like a button) and when I click it, I execute a Javascript function and that is where I also want to create/modify and store the variable which is the value in the HTML textbox
My main problem lies that Im trying to create a client side languge based (JS) global variable and then trying to access in server side language based (PHP) pages. I have to be able to access it from other JS, PHP, PHTML, HTML, etc. pages.
A cookie comes to mind but I tried "document.cookie" and it doesnt work; I suppose that it only applies to the CURRENT document at hand. The other option Ive read about is using Ajax but I have no idea how to do it and for ONE thing I perfer another solution almost :)
Thanks for all the help!
Link to comment
https://www.neowin.net/forum/topic/1075561-declare-a-global-variable-i-can-use-all-over-a-website/Share on other sites
6 answers to this question
Recommended Posts