Ok, I wrote a simple script that allows the users to enter a headline and some news, and with the click of a button, post it on the main page of his site. Well, it works great for the most part. There is a preview option, as well as password authentication.
When my employer uses the preview option, it works fine, but when he presses "back" to get back to the form, everything he entered is cleared, so he has to type it all over again. The same thing happens if he forgets to enter a password or enters an invalid one. It is obviously a setting with his browser's caching, as it works fine on my computer and every one I've tried it one. While I could tell him to change the settings on his browser, I was wondering if anyone could think of a way to get the script to "remember" what's been entered either if he visits the preview or the invalid password dialog.
It had occured to me to write what he enteres to a temporary file, but that would be inefficient. I also considered writing a hidden form to the preview and invalid password pages, and having him click a "back" button that submits the data back to the script. Lastly, and probably the best method, would be to use browser cookies. (there is not a large amount of data entered so it should be fine). If anyone has any suggestions that would be great.
SECONDLY, when the script does post the news, I want it to return to the index of the home page.
If I do "Location: /index.html\n\n" it works fine, but in the address bar is the location of the script, so if I reload, it tries to reload the script and not the page. Is there any way to not have this happen without printing a short meta or javascript redirect page?
thanks
When my employer uses the preview option, it works fine, but when he presses "back" to get back to the form, everything he entered is cleared, so he has to type it all over again. The same thing happens if he forgets to enter a password or enters an invalid one. It is obviously a setting with his browser's caching, as it works fine on my computer and every one I've tried it one. While I could tell him to change the settings on his browser, I was wondering if anyone could think of a way to get the script to "remember" what's been entered either if he visits the preview or the invalid password dialog.
It had occured to me to write what he enteres to a temporary file, but that would be inefficient. I also considered writing a hidden form to the preview and invalid password pages, and having him click a "back" button that submits the data back to the script. Lastly, and probably the best method, would be to use browser cookies. (there is not a large amount of data entered so it should be fine). If anyone has any suggestions that would be great.
SECONDLY, when the script does post the news, I want it to return to the index of the home page.
If I do "Location: /index.html\n\n" it works fine, but in the address bar is the location of the script, so if I reload, it tries to reload the script and not the page. Is there any way to not have this happen without printing a short meta or javascript redirect page?
thanks