• Resolved robbgraves

    (@robbgraves)


    I have used the code changes to CF7 in the past for the classes.php file in previous versions of CF7 to get it to work with IIS6 but recently when we upgraded to WP 3.8.1 and CF7 3.7 I could no longer just upload the modified classes.php file because the code is so radically different in the later versions of this fine plugin that using the old file breaks it.

    I’m still stuck using IIS 6 for now, and I need to know if anyone knows what modifications I would have to make to the classes.php file to get it to work with permalinks again.

    Any help is much appreciated.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter robbgraves

    (@robbgraves)

    Anyone know what I am talking about? I am using a custom 404 so that permalinks will work in IIS6. We had to originally change the older versions of the plugin by editing the classes.php file in the includes folder with this code:

    /* Generating Form HTML */
    
    	function form_html() {
    		$form = '<div class="wpcf7" id="' . $this->unit_tag . '">';
    
    		global $post;
            $url = '/index.php?page_id='.$post->ID;
    
    		if ( $frag = strstr( $url, '#' ) )
    			$url = substr( $url, 0, -strlen( $frag ) );
    
    		$url .= '#' . $this->unit_tag;
    
    		$url = apply_filters( 'wpcf7_form_action_url', $url );
    
    		$class = 'wpcf7-form';
    
    		if ( $this->is_posted() ) {
    			if ( empty( $_POST['_wpcf7_result']['valid'] ) )
    				$class .= ' invalid';
    			elseif ( ! empty( $_POST['_wpcf7_result']['spam'] ) )
    				$class .= ' spam';
    			elseif ( ! empty( $_POST['_wpcf7_result']['mail_sent'] ) )
    				$class .= ' sent';
    			else
    				$class .= ' failed';
    		}

    but in the newer versions of the plugin, this code isn’t relevant. any ideas of how i can get the plugin to work?

    Thread Starter robbgraves

    (@robbgraves)

    Finally got it to work. Found the old solution at: https://www.ads-software.com/support/topic/plugin-contact-form-7-contact-form-7-iis-404-handlerphp

    still works.

    replaced

    $url = wpcf7_get_request_uri();

    with

    $url = ‘/index.php/’.parse_url($_SERVER[‘REQUEST_URI’]);

    in the Contact 7 classes.php file

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘CF7 latest version and IIS 6 with permalinks’ is closed to new replies.