Hello Everybody
We have two sites running with couchcms. One page has a form where the data is stored in cloned page. the other site should embed the same form. I tried doing it the following way:
A template named 'external-form.php' on the primary site:
The form itself is like the following:
On the secondary site (separate couch intallation) I embed the form from the primary site in the following way:
The form is correctly embedded on the secondary site, but after submitting, couch sais that the session key is not correct.
It is important that the data filled in on the secondary site is stored in the database on the primary site.
Anybody an idea how to solve the problem with the session key?
Kind regards,
Oliver
We have two sites running with couchcms. One page has a form where the data is stored in cloned page. the other site should embed the same form. I tried doing it the following way:
A template named 'external-form.php' on the primary site:
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Embeddable form on primary site' clonable='0'>
<cms:editable name='formfield1' ... />
...
</cms:template>
<cms:embed form.html />
<?php COUCH::invoke(); ?>
The form itself is like the following:
- Code: Select all
<cms:form
masterpage='external-form.php'
mode='create'
enctype='multipart/form-data'
method='post'
anchor='0'
action='http://url.to.primary.site/external-form.php'
>
<cms:if k_success >
<cms:db_persist_form
_invalidate_cache='0'
formfield1=frm_formfield1
_auto_title='1'
/>
</cms:if>
<cms:input type="bound" id="formfield1" name="formfield1" />
</cms:form>
On the secondary site (separate couch intallation) I embed the form from the primary site in the following way:
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Secondary site with embedded form from primary site' clonable='0'>
</cms:template>
<!doctype html>
<html lang="de">
<head></head>
<body>
<?php echo file_get_contents("http://url.to.primary.site/external-form.php") ?>
</body>
</html>
<?php COUCH::invoke(); ?>
The form is correctly embedded on the secondary site, but after submitting, couch sais that the session key is not correct.
It is important that the data filled in on the secondary site is stored in the database on the primary site.
Anybody an idea how to solve the problem with the session key?
Kind regards,
Oliver