• Resolved nxnla

    (@nxnla)


    I have been using Fast Secure Contact Form for about a year now. I saw an upgrade notice so I installed it. Now I have the following error:

    Warning: Cannot modify header information - headers already sent by (output started at /hermes/bosoraweb002/b1005/ipw.smgc/public_html/member/contact.html:9) in /hermes/bosoraweb002/b1005/ipw.smgc/public_html/admin/wp-content/plugins/si-contact-form/wp-session/class-wp-session.php on line 92

    This error occurs on all my HTML pages with this code at the top:

    <?php
    define('WP_USE_THEMES', false);
    require('admin/wp-blog-header.php');
    ?>

    I don’t use WP pages or themes. For all the WordPress plugins I use I insert plugins with shortcode where I want them to appear in my code. I’m not a php wiz, so I don’t know why this error is happening. Can you give me some advice?

    https://www.ads-software.com/extend/plugins/si-contact-form/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Something in your site has an error that makes the session not work.
    A session cannot start if HTML headers are already output, or if any HTML or white space is output before the HTML headers. Maybe your wp-blog-header.php has errors or is printing HTML before the header. It problem in your example is on line 9 of contact.html

    Output can be:

    Unintentional:
    Whitespace before <?php or after ?>
    UTF-8 Byte Order Mark
    Previous error messages or notices
    Intentional:
    print, echo and other functions producing output (like var_dump)
    Raw <html> areas before <?php code.

    Troubleshooting guide
    https://stackoverflow.com/questions/8028957/headers-already-sent-by-php

    If you need more help, a link to your site would be useful.

    Thread Starter nxnla

    (@nxnla)

    Ok, I’ve had session issues before with my particular site. Every html page with the following code above the html header has the error msg I posted in my first message:

    <?php
    require_once("../isAuthenticated.php");
    if(!$isAuthenticated) {
      header("Location: ../index.html");  // Where do you want to send them?
      exit;
    }
    ?>
    
    <?php
    define('WP_USE_THEMES', false);
    require('../admin/wp-blog-header.php');
    ?>

    My site uses sessions and after some research I found I have to comment out the following line from the WP file wp-settings.php:

    wp_unregister_GLOBALS();

    Is there an issue with my site now that you have session code in your “class-wp-session.php” file? I don’t think I had that file in my previous version of your Fast Secure Contact Form. Can I roll back to the previous version? I still have the wp plugin directory of the previous version.

    The problem in your code is the close PHP tag, two lines of whitespace and open PHP tag again. Do not do that

    Try this:

    <?php
    require_once("../isAuthenticated.php");
    if(!$isAuthenticated) {
      header("Location: ../index.html");  // Where do you want to send them?
      exit;
    }
    
    define('WP_USE_THEMES', false);
    require('../admin/wp-blog-header.php');
    ?>

    Also your web host must have register_globals set to “Off”,
    If it is On , that could be causing the problem.

    You can upload a file named php.ini to your site root folder containing the following line:
    register_globals Off
    I suggest asking your web host if this is the correct way they suggest.

    After that, there is no need to comment “wp_unregister_GLOBALS()” out any more.

    Sessions are required for this plugin and your web host must have register_globals set to “Off”
    Yes you can downgrade to a prior version.

    Was that the help you need?

    Mike

    Thread Starter nxnla

    (@nxnla)

    I made the change in my php.ini file. I removed the comment from the wp-settings.php file. I removed the spaces above the html tag and combined the two php portions into one php tag. Tried viewing the page and I got a page not found http 404 error page. I put the original two php tags back to how I had them and the page was viewable just fine, but still had the error I described at the very top of this thread. Very strange.

    I won’t take your time anymore. I’ll try to delve deeper into the code and try not to botch it up as much.

    BTW, how do I revert to the previous version? Can I just copy the previous files back onto the server?

    You can revert to the previous version if you want, here is how:
    If the plugin still works, I recommend backing up all your forms first:
    https://www.fastsecurecontactform.com/backup-restore-forms

    The forms and settings are not stored in the plugin folders, but DO NOT delete the plugin from the WP admin page or the forms get deleted from the WP database.

    You can download the older version zip files here:
    https://www.ads-software.com/extend/plugins/si-contact-form/developers/
    Download and unzip the version you want to try.
    FTP to the server
    go to
    /wp-content/plugins/
    delete the
    /si-contact-form/ folder

    Upload the unzipped /si-contact-form/ folder

    You may have to activate the plugin again on the WP plugin panel.

    I got also a nice crash with the last update:

    Fatal error: Class ‘WP_Session’ not found in /var/www/g5888/mysite.nl/HTML/wp-content/plugins/si-contact-form/si-contact-form.php on line 1994

    tomholland, you should have started a new topic. Your error is different.

    The error you have is not a bug in the program. it appears to be an installation or permissions problem.

    The forms and settings are not stored in the plugin folders, but DO NOT delete the plugin from the WP admin page or the forms and settings get deleted from the WP database.

    Try a Manual Uninstall / Auto Install
    https://www.fastsecurecontactform.com/reinstall-wordpress-version

    Thread Starter nxnla

    (@nxnla)

    Thank you very much, Mike. I have rolled it back to the version right before the one giving me problems. Restored my forms. All good.

    Thanks again.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Update to latest version & now have php errors’ is closed to new replies.