Form Admin Panel Tue, 19 Sep 17 14:44:07 -0400 Form Admin Panel en-CA Make email form not be cached by browsers and proxy servers Thu, 22 Sep 2011 16:48:10 -0400 admin 15@/forum/index.php?p=/discussions Question:

I would like to make sure the web browser does not store the form in
cache. What shall I add to the code to make sure the browser gets code
every time


In form.lib.php, you can add the following highlighted code to force the form not be cached by browser or proxy :

function phpfmg_init(){

  error_reporting( E_ERROR );
  ini_set('magic_quotes_runtime', 0);
  ini_set( 'max_execution_time', 0 );
  ini_set( 'max_input_time', 36000 );

  if ( get_magic_quotes_gpc() && isset($_POST) ) {
      phpfmg_stripslashes( $_POST );

function phpfmg_no_cache(){
    $expired = gmdate( "D, d M Y H:i:s", time()-1800 ) . " GMT"; // 1800 seconds ago
    header("Expires: " . $expired );
    header("Last-Modified: " .$expired );
    header("Cache-Control: post-check=0, pre-check=0, max-age=0, no-store, no-cache, must-revalidate");
    header("Pragma: no-cache");

Please remember to upload the updated file back to your website.

You might also want to read below information. I copied it from :

You may find that your pages aren't cached even if you don't
output all of the headers above. There are a number of options
that users may be able to set for their browser that change its
default caching behavior. By sending the headers above, you should
override any settings that may otherwise cause the output of your
script to be cached.

Additionally, session_cache_limiter() and
the session.cache_limiter configuration
setting can be used to automatically generate the correct
caching-related headers when sessions are being used.

Why I receive email with username and password sent by the Form Admin Panel? Tue, 22 Mar 2011 16:09:09 -0400 admin 7@/forum/index.php?p=/discussions
I have changed the "forgot password" process for the email form admin panel. A email verification from will be shown before sending email of the account information. So the new form will not have the problem again.

In order to fix the unrequested email for the old forms,  two methods can be used to fix the problem completely :

1) edit the admin.php manually, remove the following mailing password function completely :

function phpfmg_mail_password(){
    if( defined( 'PHPFMG_USER' ) && defined( 'PHPFMG_PW' ) ){
        $body = "Here is the password for your form admin panel:\n\nUsername: " . PHPFMG_USER . "\nPassword: " . PHPFMG_PW . "\n\n" ;
        if( 'html' == PHPFMG_MAIL_TYPE )
            $body = nl2br($body);
        mailAttachments( PHPFMG_USER, "Password for Your Form Admin Panel", $body, PHPFMG_USER, 'You', "You <" . PHPFMG_USER . ">" );
        echo "<center>Your password has been sent.<br><br><a href='admin.php'>Click here to login again</a></center>";

2) or login to admin.php to re-generate the form, and use the new admin.php to replace your old one. Because I change the whole process on the "forgot password". It will verify the email first before sending the password. See screen shot for detail.