0

Say in index.html you set variable x to be 5.
You navigate to a different page, lets say pageone.html.
How can you keep x to 5?
And if you change x to 3 on pageone.html, how can you keep it to 3 on pagetwo.html? (the whole website also, every webpage)
Is this possible in javascript or do you need php?

Will give more explanations if needed.
thanks

edit: i did try googling, but i really didnt know how to phrase it for a search so it kinda messed up.

edit 2:
think umm.. like a shop website, you add something to your basket, the basket will say 1 item and will stay like that on every webpage.

Edited by FriXionX: n/a

3
Contributors
4
Replies
6
Views
5 Years
Discussion Span
Last Post by FriXionX
0

Javascript can read & write information to both cookies and a special client side storage area if a large amount of stuff needs to be stored. However it is not very secure as the visitor can ammend any data stored in their browser.

PHP does this sort of thing a lot better using session variables, plenty of good tuts out there.

0

Javascript can read & write information to both cookies and a special client side storage area if a large amount of stuff needs to be stored. However it is not very secure as the visitor can ammend any data stored in their browser.

PHP does this sort of thing a lot better using session variables, plenty of good tuts out there.

It's okay, this is just for college. We were only supposed to do a simple webpage (not even including css) but i've gone way overboard trying to get a distinction. Anything will do at this point. I don't really want to use php right now really, so do you think javascript would be okay?

Edited by FriXionX: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.