PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
That's my existing HTML/javascript code written using Netbeans, and I need some help with some PHP (server side scripting) to add to it. Can I host this on Dropbox and use PHP? If yes then what I would like to do is make the webpage remember what state the image is in. Etc if it is currently in Yakutat-Bay-city-overlay_01X.jpg (state 2) then when the next person opens the page it is in state 2 rather then the beginning (state 0).
Durfsurn wrote:what I would like to do is make the webpage remember what state the image is in. Etc if it is currently in Yakutat-Bay-city-overlay_01X.jpg (state 2) then when the next person opens the page it is in state 2 rather then the beginning (state 0).
Saving the state can be done several ways in PHP. You could use cookies or the PHP session system for individual users. If you want it to be accessed by multiple users then a database or some kind of cache would be needed.
I would need a database or a cache. I want it so when P1 opens http://www.mywebsite.com then changes something then when P2 opens http://www.mywebsite.com it has that change recorded and saved until further changed.\
Durfsurn wrote:I would need a database or a cache. I want it so when P1 opens http://www.mywebsite.com then changes something then when P2 opens http://www.mywebsite.com it has that change recorded and saved until further changed.
What is the "something" that changes? It sounds like an image rotater where a person sees the next image every time they visit the page. Those usually use a cookie.
Whether it would suffice depends on your specific needs, I suppose, but that's the route I'd take. Cookies are per user. I think it's safe to assume cookies will be enabled 99+% of the time. How well they work would depend on the expiry you choose and how frequently users visit your site.
Thanks for the insight. I will try the cookie method first. Now how would I go about doing that? Do I just need to make a PHP script and have it load on the site? Also I don't know how to program in PHP so could I have some help?