Hi,
I've build a website with a single contact form that is included on 3 separate clonable pages.
The contact form has it's own template named contact.php.
After submitting the form the form returns to contact.php but I want it to redirect back to the last page: info.php?p=46.
Redirect seems to be the solution but I can't get it to work properly.
Any help is much appreciated.
Thanks.
I've build a website with a single contact form that is included on 3 separate clonable pages.
The contact form has it's own template named contact.php.
After submitting the form the form returns to contact.php but I want it to redirect back to the last page: info.php?p=46.
Redirect seems to be the solution but I can't get it to work properly.
Any help is much appreciated.
Thanks.
- Code: Select all
<cms:pages masterpage='contact.php'>
<div class="contactform">
<cms:form anchor='0' method="post">
<cms:show_repeatable 'form' >
<cms:php>
global $FUNCS, $CTX;
$name = $FUNCS->get_clean_url( $CTX->get('title') );
$CTX->set( 'name', $name );
</cms:php>
<label for="<cms:show title />"><cms:show title /></label>
<cms:input
type="<cms:if type='email'>text<cms:else /><cms:show type /></cms:if>"
name="<cms:show name/>"
id="<cms:show name/>"
required="<cms:show required />"
validator="<cms:if type='email'>email</cms:if>"
validator_msg="<cms:if text>required=<cms:show text /><cms:if type='email'> | email=<cms:show text /></cms:if></cms:if>"
opt_values="<cms:show options />"
/>
<cms:set my_error="<cms:get "k_error_<cms:show name/>" />" />
<cms:if my_error>
<h6 class="alert" id="<cms:show name/>_error" class="alert"><cms:show my_error /></h6>
</cms:if>
</cms:show_repeatable>
<label class="required" for="human">* Anti-spam question:<br />The sky is: <strong>blue</strong> or red?</label>
<cms:input type="text" required='1' validator='regex=/^blue$/i' class="input-text required-entry" id="human" name="human"/>
<cms:if k_error_human>
<h6 class="alert_human">Type "<strong>blue</strong>" as the answer.</h6>
</cms:if>
<button type="submit" value="Submit"/>Send</button>
<cms:if k_success>
<cms:send_mail from=k_email_from to=k_email_to bcc=frm_emailadres subject='Contactform website'>
The email has been send from Contactform: <cms:show k_page_title /> :
<cms:each k_success sep='\n'>
<cms:show item /><br>
</cms:each>
</cms:send_mail>
<cms:redirect k_page_link />
</cms:if>
</cms:form>
</div>
</cms:pages>