IEM::sessionSet('SubscriberInfo', $subscriber_info); IEM::sessionSet('Subscriber', $subscriber_id); IEM::sessionSet('Form', $form); $formhtml = $formapi->Get('formhtml'); $placeholders[] = '%%FORMACTION%%'; $placeholder_values[] = SENDSTUDIO_APPLICATION_URL . '/updatedetails.php'; if ($formapi->usecaptcha) { $captcha_api = $sendstudio_functions->GetApi('Captcha'); $captcha_api = new Captcha_API(); // so we don't include the session stuff in the captcha image, we set this flag for now. // this stops the session from being blanked out when you submit and causing an error. $captcha_api->Set('modify_details', true); $captcha_api->CreateSecret(); $placeholders[] = '%%captchaimage%%'; $placeholder_values[] = $captcha_api->ShowCaptcha(); } // pre-fill the form. $formhtml = str_replace($placeholders, $placeholder_values, $formhtml); // get rid of anything we don't need. $formhtml = preg_replace('/%%CustomField_(.*?)%%/', '', $formhtml); $formhtml = preg_replace('/%%Lists_(.*?)%%/', '', $formhtml); // print 'er out!