Hi,
I am trying to get the last inserted page id from a db_persist_form into another db_persist but I can't seems to get my head around it because the k_last_insert_id is not setting. this is what I did:
Code: Select all
<cms:form masterpage="domain.php" mode='create' enctype='multipart/form-data' method='post' anchor=''>
<cms:if k_success>
<cms:db_persist_form _invalidate_cache='0' _auto_title='0' k_page_title=frm_domain_name domain_owner=k_user_id domain_name=frm_domain_name domain_extension=k_page_id domain_prd=frm_domain_prd domain_status='Pending setup'  />
<cms:if k_success>
<cms:if k_page_id='-1'>
<cms:pages masterpage='domain.php' id=k_last_insert_id limit='1' show_future_entries='1'>                                       
<cms:set last_page_id="<cms:show k_last_insert_id />" scope='global' />
<cms:set last_added_page_name="<cms:show k_last_insert_page_name />" scope='global' />
</cms:pages>
</cms:if>
</cms:if>

<cms:if k_success>
<cms:db_persist _masterpage="hostings.php" _invalidate_cache='0'  _auto_title='0'  _mode='create' k_page_title=frm_domain_name hosting_owner=k_user_id hosting_domain=k_page_id hosting_plan=frm_hosting_package hosting_prd=frm_hosting_prd hosting_status='Pending setup' >
</cms:db_persist>

<!-- send email -->
<cms:send_mail from="<cms:php>echo K_EMAIL_FROM;</cms:php>" to=k_user_email subject='New Ticket' debug='1'>
Email content here
</cms:send_mail>

<cms:set_flash name='success_msg' value='1' />

<cms:redirect url="<cms:show current_page />" />
</cms:if>
</cms:if>
.... All databound form inputs ......
</cms:form>