Let's say hypothetically that I have a Div that contains the background color 'red' and I would like the user to input into a separate input box to the side of the div what color he would like this box to be changed to. How would I go about allowing this type of functionality through php so that the color chosen (and not the default 'red') remains as the color once the user has left the webpage and another has logged on?
Basically how can I allow the users choice to be final so that users can see this afterwards?
Thanks in advance!
You cannot do it on a client side. The HTML code should be generated on a server side and along with addition to DOM, AJAX call should be made to server-side script to include new elements in subsequent generations.
And you should also provide some sort of authorisation, or else your website will be full of Viagra and Forex links in no time...
You have to send the number of appended items back to the server and the server has to store that number in a database. Then, the next time the page is requested, the server can either render them or it can send the information to the client and the client can render it.