Contact form in adobe Muse CC

first of all sorry because I don´t know nothing about codes. I am using adobe muse CC do make a website.
When I do the contact form, it doesn´t work properly in my host. I read a lot of forums, even here, but could not solve the problem. I read about PHP codes, but didn´t find a solution. Someone can help me? Thanks anyway. Marina

1 Like

Can you show us the code in question?

Thanks for your cooperaton I have a lot of pages in the the scrip folder, Hereby s the script PHP

If you see this text in your browser, PHP is not configured correctly on this hosting provider. 
Contact your hosting provider regarding PHP configuration for your site.

PHP file generated by Adobe Muse CC 2017.0.2.363


function process_form($form) {

	if (formthrottle_too_many_submissions($_SERVER['REMOTE_ADDR']))
	// will die() if there are any errors
	// will die() if there is a send email problem

function get_form_error_response($error) {
	return get_form_response(false, array('error' => $error));

function get_form_response($success, $data) {
	if (!is_array($data))
		die('data must be array');
	$status = array();
	$status[$success ? 'FormResponse' : 'MusePHPFormResponse'] = array_merge(array('success' => $success), $data);
	return json_serialize($status);

function check_required_fields($form) {
	$errors = array();

	foreach ($form['fields'] as $field => $properties) {
		if (!$properties['required'])

		if (!array_key_exists($field, $_REQUEST) || ($_REQUEST[$field] !== "0" && empty($_REQUEST[$field])))
			array_push($errors, array('field' => $field, 'message' => $properties['errors']['required']));
		else if (!check_field_value_format($form, $field, $properties))
			array_push($errors, array('field' => $field, 'message' => $properties['errors']['format']));

	if (!empty($errors))
		die(get_form_error_response(array('fields' => $errors)));

function check_field_value_format($form, $field, $properties) {
	$value = get_form_field_value($field, $properties, $form['resources'], false);

	switch($properties['type']) {
		case 'checkbox':
		case 'string':
		case 'captcha':
			// no format to validate for those fields
			return true;

		case 'checkboxgroup':
			if (!array_key_exists('optionItems', $properties))
				die(get_form_error_response(sprintf($form['resources']['invalid_form_config'], $properties['label'])));

			// If the value received is not an array, treat it as invalid format
			if (!isset($value))
				return false;

			// Check each option to see if it is a valid value
			foreach($value as $checkboxValue) {
				if (!in_array($checkboxValue, $properties['optionItems']))
					return false;

			return true;

		case 'radiogroup':
			if (!array_key_exists('optionItems', $properties))
				die(get_form_error_response(sprintf($form['resources']['invalid_form_config'], $properties['label'])));

			//check list of real radio values
			return in_array($value, $properties['optionItems']);
		case 'recaptcha':
			if (!array_key_exists('recaptcha', $form) || !array_key_exists('private_key', $form['recaptcha']) || empty($form['recaptcha']['private_key']))
			$resp = recaptcha_check_answer($form['recaptcha']['private_key'], $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
			return $resp->is_valid;

		case 'recaptcha2':
			if (!array_key_exists('recaptcha2', $form) || !array_key_exists('private_key', $form['recaptcha2']) || empty($form['recaptcha2']['private_key']))

			$resp = recaptcha2_check_answer($form['recaptcha2']['private_key'], $_POST["g-recaptcha-response"], $_SERVER["REMOTE_ADDR"]);
			return $resp["success"];

		case 'email':
			return 1 == preg_match('/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i', $value);

		case 'radio': // never validate the format of a single radio element; only the group gets validated
			die(get_form_error_response(sprintf($form['resources']['invalid_field_type'], $properties['type'])));

 * Returns an object with following properties:
 *	"success": true|false,
 *	"challenge_ts": timestamp,  // timestamp of the challenge load (ISO format yyyy-MM-dd'T'HH:mm:ssZZ)
 *	"hostname": string,         // the hostname of the site where the reCAPTCHA was solved
 *	"error-codes": [...]        // optional; possibe values:
 *									missing-input-secret - The secret parameter is missing
 *									invalid-input-secret - The secret parameter is invalid or malformed
 *									missing-input-response - The response parameter is missing
 *									invalid-input-response - The response parameter is invalid or malformed
function recaptcha2_check_answer($secret, $response, $remoteIP) {
	$url = '';
	$data = array(
		'secret' => $secret,
		'response' => $response,
		'remoteip' => $remoteIP

	$options = array(
		'http' => array(
			'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
			'method'  => 'POST',
			'content' => http_build_query($data)
	$context = stream_context_create($options);
	$contents = file_get_contents($url, false, $context);
	if ($contents === FALSE) {

	$result = (array) json_decode($contents);
	return $result;

function email_form_submission($form) {
		define('PHP_EOL', '\r\n');

	$form_email = ((array_key_exists('Email', $_REQUEST) && !empty($_REQUEST['Email'])) ? cleanup_email($_REQUEST['Email']) : '');

	$to = $form['email']['to'];
	$subject = $form['subject'];
	$message = get_email_body($subject, $form['heading'], $form['fields'], $form['resources']);
	$headers = get_email_headers($to, $form_email);	

	$sent = mail($to, $subject, $message, $headers, "-r"."");
	$success_data = array(
		'redirect' => $form['success_redirect']
	echo get_form_response(true, $success_data);

function get_email_headers($to_email, $form_email) {
	$headers = 'From: ' . $to_email . PHP_EOL;
	$headers .= 'Reply-To: ' . $form_email . PHP_EOL;
	$headers .= 'X-Mailer: Adobe Muse CC 2017.0.2.363 with PHP' . PHP_EOL;
	$headers .= 'Content-type: text/html; charset=utf-8' . PHP_EOL;
	return $headers;

function get_email_body($subject, $heading, $fields, $resources) {
	$message = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">';
	$message .= '<html xmlns="">';
	$message .= '<head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><title>' . encode_for_form($subject) . '</title></head>';
	$message .= '<body style="background-color: #ffffff; color: #000000; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 18px; font-family: helvetica, arial, verdana, sans-serif;">';
	$message .= '<h2 style="background-color: #eeeeee;">' . $heading . '</h2>';
	$message .= '<table cellspacing="0" cellpadding="0" width="100%" style="background-color: #ffffff;">'; 

	$sorted_fields = array();
	foreach ($fields as $field => $properties) {
		// Skip reCAPTCHA from email submission
		if ('recaptcha' == $properties['type'] || 'recaptcha2' == $properties['type'])

		array_push($sorted_fields, array('field' => $field, 'properties' => $properties));

	// sort fields
	usort($sorted_fields, 'field_comparer');

	foreach ($sorted_fields as $field_wrapper)
		$message .= '<tr><td valign="top" style="background-color: #ffffff;"><b>' . encode_for_form($field_wrapper['properties']['label']) . ':</b></td><td>' . get_form_field_value($field_wrapper['field'], $field_wrapper['properties'], $resources, true) . '</td></tr>';

	$message .= '</table>';
	$message .= '<br/><br/>';
	$message .= '<div style="background-color: #eeeeee; font-size: 10px; line-height: 11px;">' . sprintf($resources['submitted_from'], encode_for_form($_SERVER['SERVER_NAME'])) . '</div>';
	$message .= '<div style="background-color: #eeeeee; font-size: 10px; line-height: 11px;">' . sprintf($resources['submitted_by'], encode_for_form($_SERVER['REMOTE_ADDR'])) . '</div>';
	$message .= '</body></html>';

	return cleanup_message($message);

function field_comparer($field1, $field2) {
	if ($field1['properties']['order'] == $field2['properties']['order'])
		return 0;

	return (($field1['properties']['order'] < $field2['properties']['order']) ? -1 : 1);

function is_assoc_array($arr) {
	if (!is_array($arr))
		return false;
	$keys = array_keys($arr);
	foreach (array_keys($arr) as $key)
		if (is_string($key)) return true;

	return false;

function json_serialize($data) {

	if (is_assoc_array($data)) {
		$json = array();
		foreach ($data as $key => $value)
			array_push($json, '"' . $key . '": ' . json_serialize($value));
		return '{' . implode(', ', $json) . '}';
	if (is_array($data)) {
		$json = array();
		foreach ($data as $value)
			array_push($json, json_serialize($value));
		return '[' . implode(', ', $json) . ']';
	if (is_int($data) || is_float($data))
		return $data;
	if (is_bool($data))
		return $data ? 'true' : 'false';
	return '"' . encode_for_json($data) . '"';

function encode_for_json($value) {
	return preg_replace(array('/([\'"\\t\\\\])/i', '/\\r/i', '/\\n/i'), array('\\\\$1', '\\r', '\\n'), $value);

function encode_for_form($text) {
	$text = stripslashes($text);
	return htmlentities($text, ENT_QUOTES, 'UTF-8');// need ENT_QUOTES or webpro.js jQuery.parseJSON fails

function get_form_field_value($field, $properties, $resources, $forOutput) {
	$value = $_REQUEST[$field];
	switch($properties['type']) {
		case 'checkbox':
			return (($value == '1' || $value == 'true') ? $resources['checkbox_checked'] : $resources['checkbox_unchecked']);
		case 'checkboxgroup':
			if (!is_array($value))
				return NULL;

			$outputValue = array();

			foreach ($value as $checkboxValue)
				array_push($outputValue, $forOutput ? encode_for_form($checkboxValue) : stripslashes($checkboxValue));
			if ($forOutput)
				$outputValue = implode(', ', $outputValue);

			return $outputValue;
		case 'radiogroup':
			return ($forOutput ? encode_for_form($value) : stripslashes($value));
		case 'string':
		case 'captcha':
		case 'recaptcha':
		case 'recaptcha2':
		case 'email':
			return encode_for_form($value);

		case 'radio': // never validate the format of a single radio element; only the group gets validated
			die(get_form_error_response(sprintf($resources['invalid_field_type'], $properties['type'])));

function cleanup_email($email) {
	$email = encode_for_form($email);
	$email = preg_replace('=((<CR>|<LF>|0x0A/%0A|0x0D/%0D|\\n|\\r)\S).*=i', null, $email);
	return $email;

function cleanup_message($message) {
	$message = wordwrap($message, 70, "\r\n");
	return $message;

There is also another script like this

If you see this text in your browser, PHP is not configured correctly on this hosting provider. 
Contact your hosting provider regarding PHP configuration for your site.

PHP file generated by Adobe Muse CC 2017.0.2.363


$form = array(
	'subject' => 'Home Form Submission',
	'heading' => 'New Form Submission',
	'success_redirect' => '',
	'resources' => array(
		'checkbox_checked' => 'Checked',
		'checkbox_unchecked' => 'Unchecked',
		'submitted_from' => 'Form submitted from website: %s',
		'submitted_by' => 'Visitor IP address: %s',
		'too_many_submissions' => 'Too many recent submissions from this IP',
		'failed_to_send_email' => 'Failed to send email',
		'invalid_reCAPTCHA_private_key' => 'Invalid reCAPTCHA private key.',
		'invalid_reCAPTCHA2_private_key' => 'Invalid reCAPTCHA 2.0 private key.',
		'invalid_reCAPTCHA2_server_response' => 'Invalid reCAPTCHA 2.0 server response.',
		'invalid_field_type' => 'Unknown field type \'%s\'.',
		'invalid_form_config' => 'Field \'%s\' has an invalid configuration.',
		'unknown_method' => 'Unknown server request method'
	'email' => array(
		'from' => '',
		'to' => ''
	'fields' => array(
		'custom_U369' => array(
			'order' => 1,
			'type' => 'string',
			'label' => 'Name',
			'required' => true,
			'errors' => array(
				'required' => 'Field \'Name\' is required.'
		'Email' => array(
			'order' => 2,
			'type' => 'email',
			'label' => 'Email',
			'required' => true,
			'errors' => array(
				'required' => 'Field \'Email\' is required.',
				'format' => 'Field \'Email\' has an invalid email.'
		'custom_U365' => array(
			'order' => 3,
			'type' => 'string',
			'label' => 'Message',
			'required' => false,
			'errors' => array(


Can you also expand on this? What does it not do that it should, or what does it do that it should not?

Hi, when I click on “submit” there is a message and the form can’t be sent, It seems the problem is in PHP but I don’t know nothing about programming. Thanks in advance . Marina

And what does the message say?

1 Like

HI, thanks at all.This is the message when I upload the site to the server.
Form PHP script is missing from web server, or PHP is not configured correctly on your hosting provider. Chec is the form PHP script has been uploaded correctly., then contact your hosting about PHP configuration.
The problem is that I don’t know nothing about programming, and the server says they do not help with programming.

The scripts are as I have sent below.
Thanks in advance. Marina

That suggests that the form is pointing to a different script than those you have posted. Either the name is incorrect in your html form (in the “action” tag) or, as the message says, maybe the server is not configured to process PHP scripts.

You could share the html form code if you wanted to, or you could contact your service provider (the company who hosts the web site) and ask them if the account is configured to run PHP.

HI, thanks again for your coope.
I have tried my service provider but they don’t give any kind of programming support. Hereby is my teste page in html. Is this enough for you to see the scrip code?

<!DOCTYPE html>
<html class="nojs html css_verticalspacer" lang="en-US">

  <meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
  <meta name="generator" content="2017.0.2.363"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <script type="text/javascript">
   // Update the 'nojs'/'js' class on the html node
document.documentElement.className = document.documentElement.className.replace(/\bnojs\b/g, 'js');

// Check that all required assets are uploaded and up-to-date
if(typeof Muse == "undefined") window.Muse = {}; window.Muse.assets = {"required":["museutils.js", "museconfig.js", "webpro.js", "", "require.js", "index.css"], "outOfDate":[]};
  <!-- CSS -->
  <link rel="stylesheet" type="text/css" href="css/site_global.css?crc=443350757"/>
  <link rel="stylesheet" type="text/css" href="css/index.css?crc=224295985" id="pagesheet"/>

  <div class="clearfix borderbox" id="page"><!-- column -->
   <form class="form-grp clearfix colelem" id="widgetu364" method="post" enctype="multipart/form-data" action="scripts/form-u364.php"><!-- none box -->
    <div class="fld-grp clearfix grpelem" id="widgetu369" data-required="true"><!-- none box -->
     <label class="fld-label actAsDiv clearfix grpelem" id="u370-4" for="widgetu369_input"><!-- content --><span class="actAsPara">Name:</span></label>
     <span class="fld-input NoWrap actAsDiv clearfix grpelem" id="u372-4"><!-- content --><input class="wrapped-input" type="text" spellcheck="false" id="widgetu369_input" name="custom_U369" tabindex="1"/><label class="wrapped-input fld-prompt" id="widgetu369_prompt" for="widgetu369_input"><span class="actAsPara">Enter Name</span></label></span>
    <div class="fld-grp clearfix grpelem" id="widgetu377" data-required="true" data-type="email"><!-- none box -->
     <label class="fld-label actAsDiv clearfix grpelem" id="u378-4" for="widgetu377_input"><!-- content --><span class="actAsPara">Email:</span></label>
     <span class="fld-input NoWrap actAsDiv clearfix grpelem" id="u379-4"><!-- content --><input class="wrapped-input" type="email" spellcheck="false" id="widgetu377_input" name="Email" tabindex="2"/><label class="wrapped-input fld-prompt" id="widgetu377_prompt" for="widgetu377_input"><span class="actAsPara">Enter Email</span></label></span>
    <div class="clearfix grpelem" id="u374-4"><!-- content -->
     <p>Submitting Form...</p>
    <div class="clearfix grpelem" id="u375-4"><!-- content -->
     <p>The server encountered an error.</p>
    <div class="clearfix grpelem" id="u376-4"><!-- content -->
     <p>Form received.</p>
    <button class="submit-btn NoWrap rounded-corners clearfix grpelem" id="u373-4" type="submit" value="Submit" tabindex="4"><!-- content -->
     <div style="margin-top:-11px;height:11px;">
    <div class="fld-grp clearfix grpelem" id="widgetu365" data-required="false"><!-- none box -->
     <label class="fld-label actAsDiv clearfix grpelem" id="u366-4" for="widgetu365_input"><!-- content --><span class="actAsPara">Message:</span></label>
     <span class="fld-textarea actAsDiv clearfix grpelem" id="u367-4"><!-- content --><textarea class="wrapped-input" id="widgetu365_input" name="custom_U365" tabindex="3"></textarea><label class="wrapped-input fld-prompt" id="widgetu365_prompt" for="widgetu365_input"><span class="actAsPara">Enter Your Message</span></label></span>
   <div class="verticalspacer" data-offset-top="348" data-content-above-spacer="348" data-content-below-spacer="152"></div>
  <!-- Other scripts -->
  <script type="text/javascript">
   window.Muse.assets.check=function(d){if(!window.Muse.assets.checked){window.Muse.assets.checked=!0;var b={},c=function(a,b){if(window.getComputedStyle){var c=window.getComputedStyle(a,null);return c&&c.getPropertyValue(b)||c&&c[b]||""}if(document.documentElement.currentStyle)return(c=a.currentStyle)&&c[b]||[b]||"";return""},a=function(a){if(a.match(/^rgb/))return a=a.replace(/\s+/g,"").match(/([\d\,]+)/gi)[0].split(","),(parseInt(a[0])<<16)+(parseInt(a[1])<<8)+parseInt(a[2]);if(a.match(/^\#/))return parseInt(a.substr(1),
16);return 0},g=function(g){for(var f=document.getElementsByTagName("link"),h=0;h<f.length;h++)if("text/css"==f[h].type){var i=(f[h].href||"").match(/\/?css\/([\w\-]+\.css)\?crc=(\d+)/);if(!i||!i[1]||!i[2])break;b[i[1]]=i[2]}f=document.createElement("div");f.className="version";"display:none; width:1px; height:1px;";document.getElementsByTagName("body")[0].appendChild(f);for(h=0;h<Muse.assets.required.length;){var i=Muse.assets.required[h],l=i.match(/([\w\-\.]+)\.(\w+)$/),k=l&&l[1]?
l[1]:null,l=l&&l[2]?l[2]:null;switch(l.toLowerCase()){case "css":k=k.replace(/\W/gi,"_").replace(/^([^a-z])/gi,"_$1");f.className+=" "+k;k=a(c(f,"color"));l=a(c(f,"backgroundColor"));k!=0||l!=0?(Muse.assets.required.splice(h,1),"undefined"!=typeof b[i]&&(k!=b[i]>>>24||l!=(b[i]&16777215))&&Muse.assets.outOfDate.push(i)):h++;f.className="version";break;case "js":h++;break;default:throw Error("Unsupported file type: "+l);}}d?d().jquery!="1.8.3"&&Muse.assets.outOfDate.push("jquery-1.8.3.min.js"):Muse.assets.required.push("jquery-1.8.3.min.js");
f.parentNode.removeChild(f);if(Muse.assets.outOfDate.length||Muse.assets.required.length)f="Some files on the server may be missing or incorrect. Clear browser cache and try again. If the problem persists please contact website author.",g&&Muse.assets.outOfDate.length&&(f+="\nOut of date: "+Muse.assets.outOfDate.join(",")),g&&Muse.assets.required.length&&(f+="\nMissing: "+Muse.assets.required.join(",")),alert(f)};location&&{g(!0)},5E3):g()}};
var muse_init=function(){require.config({baseUrl:""});require(["jquery","museutils","whatinput","webpro",""],function(d){var $ = d;$(document).ready(function(){try{
window.Muse.assets.check($);/* body */
Muse.Utils.transformMarkupToFixBrowserProblemsPreInit();/* body */
Muse.Utils.prepHyperlinks(true);/* body */
Muse.Utils.fullPage('#page');/* 100% height page */
Muse.Utils.initWidget('#widgetu364', ['#bp_infinity'], function(elem) { return new WebPro.Widget.Form(elem, {validationEvent:'submit',errorStateSensitivity:'high',fieldWrapperClass:'fld-grp',formSubmittedClass:'frm-sub-st',formErrorClass:'frm-subm-err-st',formDeliveredClass:'frm-subm-ok-st',notEmptyClass:'non-empty-st',focusClass:'focus-st',invalidClass:'fld-err-st',requiredClass:'fld-err-st',ajaxSubmit:true}); });/* #widgetu364 */
Muse.Utils.showWidgetsWhenReady();/* body */
Muse.Utils.transformMarkupToFixBrowserProblems();/* body */
}catch(b){if(b&&"function"==typeof b.notify?b.notify()"Error calling selector function: "+b),false)throw b;}})})};

  <!-- RequireJS script -->
  <script src="scripts/require.js?crc=4234670167" type="text/javascript" async data-main="scripts/museconfig.js?crc=4152223963" onload="if (requirejs) requirejs.onError = function(requireType, requireModule) { if (requireType && requireType.toString && requireType.toString().indexOf && 0 <= requireType.toString().indexOf('#scripterror')) window.Muse.assets.check(); }" onerror="window.Muse.assets.check();"></script>

I have seen that in the muse pag. the form is a little different, It doesn’t include “submiting form”, nor “the server encountered an error” and “form received”.
I have tryed the form in the jotform website, but the question is that they have advertising at the end of the form, or we have to pay. Maybe you can suggest another possibility or have another kind of form ( li the possibilities offered by the jotform website.
Thanks a ot for your attention. Marina

sorry, i don’t understand why I copy the code from my page and it doesn’t appear hear.I tried to send in a text format,

code form.txt (7.3 KB)


Did you know... (about Discourse)

OK, this line of code here in your form:

<form class="form-grp clearfix colelem" id="widgetu364" method="post" enctype="multipart/form-data" action="scripts/form-u364.php"><!-- none box -->

has a section that says


which means that when you submit the form, it will look for a script called “form-u364.php” in your scripts folder. So the first question is, do you have that file present in that folder? I know you posted your scripts in the first post, but you didn’t say what they were called.

If the script is present, and in the correct place, then I can only presume that the second part of the error message you posted is the relevant bit, and you should contact the hosting provider to see if PHP is configured correctly. That’s not PHP programming support, that’s general customer service on whether the host is even capable of running PHP scripts - not all of them are, your account might not support it. Only your host can confirm that.

One other question, and please don’t be offended. You mentioned earlier on that you have no programming knowledge, and yet you’ve got some pretty complex code considering it’s only a form to gather a couple of information fields and email them to you. Where has that code come from, and can they not help in getting it uploaded and working correctly?

The contact form was made in the Adobe Muse CC application. It is easy enough to do it… Just drag to the page,. the item that is in library file, and fill with the sending email. When you export the page to html it generates a script folder.The Adobe Muse suppot says that the form is ok if the site would be published with the adobe catalyst. And I don´t want this. I pay a server and want to use it… My server says that they support PHP but don´t teach how to configure.
You asked about the script line…action= “script?form-u364.pp”. I checked the scrips folder and have seen the name is a little diferente.I upload hereby all the pages generated when I save as html, my test page.
Maybe you have another kind of solution, a new code form.
I am really happy for all your kind attention and patient. If this doesn´t have a solution, please don´´t bother anymore. I am upset for so much work for you…Thanks again.
muse (136.0 KB)

Well, either rename the name so it’s the same as the one in your html, or edit your html to match the name that is in the scripts folder - there’s no such thing as “a little different” here, it’s either the same (and correct) or not the same (and therefore incorrect).

There are many examples of form submission and the corresponding PHP code to process the contents on this forum if you search further down.

1 Like

Thanks anyway.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.