• Hello, I am trying to help a colleague with a feature that has broken on his site. The entries are getting to the database but there is an xml file that is to be generated when the form is submitted. The paths look correct to me but the files don get get generated as the code suggests. Any help much appreciated The permission are good on the folder.

    This is from a custom.php file in their theme/lib/ folder

    function processNeighborhoodInquiry($arrData)
    {
    if (empty($arrData[‘fastsales-id’])) {
    $arrData[‘fastsales-id’] = ‘elead’;
    }

    //$xml = file_get_contents(‘http://maracayhomes.com/contact/xml?’
    $xml = file_get_contents(‘http://maracayhomes.com/contact/xml?’
    . ‘first_name=’ . urlencode($arrData[‘first-name’])
    . ‘&last_name=’ . urlencode($arrData[‘last-name’])
    . ‘&email=’ . urlencode($arrData[’email’])
    . ‘&phone=’ . urlencode($arrData[‘phone’])
    . ‘&address=’
    . ‘&city=’
    . ‘&state=’
    . ‘&zip=’
    . ‘&comment=’ . urlencode($arrData[‘message’])
    . ‘&referrer=’
    . ‘&move_in=’
    . ‘&community=’ . urlencode($arrData[‘fastsales-id’])
    . ‘&ftp=false’
    );

    // upload to ftp

    $strFile = fopen(‘/var/www/vhosts/maracayhomes.com/httpdocs/fastsales/’ . time() . ‘.xml’, ‘w+’);
    fwrite($strFile, $xml);
    fclose($strFile);

    }

    https://wordpress.org/plugins/contact-form-7-to-database-extension/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Writing XML file to directory’ is closed to new replies.