I'm writing a php script which will enable people to change the theme of their drupal website. So far, so good but one last thing I couldn't figure out. Every time when I submit the form, the database is changed but the theme doesn't change. Apparently, I have to clear the cache as well. I found this on the Drupal website:
<?php
include_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_flush_all_caches();
?>
I should make a little file 'clear.php' with this script, and every time I want to clear the cache, I should go to this file and the cache shout be cleared...
But their is my problem. I don't know how to call this page in my script. Sure I can make a button which will redirect the user to this page, but I'ld like it in one script.
Any idea's? Or are their other ways to flush the Drupal cache using php?
Thanks in advance!