HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/shootinschool/wp-content/plugins/activecampaign-subscription-forms/form_process.php
<?php

    // only Ajax requests come through here
if (!session_id()) {
    session_start();
}

    require_once("../../../wp-load.php");
    $settings = get_option("settings_activecampaign");

    $api_url = $settings["api_url"];
    $api_key = $settings["api_key"];
    $sync = $_GET["sync"];
    $captcha = (strpos(current($settings["form_html"]), "<input type='text' name='captcha'") !== false) ? 1 : 0;

    require_once(dirname(__FILE__) . "/activecampaign-api-php/ActiveCampaign.class.php");
    $ac = new ActiveCampaignWordPress($api_url, $api_key);

    $form_process = $ac->api("form/process?sync={$sync}&captcha={$captcha}");

if ($form_process) {
    // form submitted via ajax
    echo $form_process;
    exit;
}