I have a PHP form that I need to force a CSS reload once submitted. How do I do this?
Thanks!
I have a PHP form that I need to force a CSS reload once submitted. How do I do this?
Thanks!
The only way I can think of to guarantee that the CSS reloads, is to change the name of the css file.
You could create a rewrite rule that redirects all addresses of type "...mycssfile.css1234" to "...mycssfile.css" and in your php, add a random 4 digits to the end of your css file location.
Edit: To reflect the comments to this answer, you can do the following:
<link rel="STYLESHEET" href="mycssfile.css?r=<?php echo rand(1, 999999); ?>" type="text/css">
Which would force the browser to update the css page, since the address to the css file changed, although it will actually link to the same css file.