I need to redirect people who submit a form to another website. How do I do that? Currently It looks like there is only one option which is to manually enter some text. I NEED it to redirect otherwise it will be messy.
THANKS!
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
I need to redirect people who submit a form to another website. How do I do that? Currently It looks like there is only one option which is to manually enter some text. I NEED it to redirect otherwise it will be messy.
THANKS!
A hackish way:
Subclass UserDefinedForm and UserDefinedForm_Controller.
In SubClass_Controller, basically c+p the process method from UserDefinedForm_Controller, except replace:
$custom = $this->customise(array(
"Content" => $this->customise( array( 'Link' => $data['Referrer'] ) )->renderWith('ReceivedFormSubmission'),
"Form" => " ",
));
return $custom->renderWith('Page');
With
Director::redirect('URL');
I think that will work. (:
Thanks for your help... But... I'm not very techie and I need to know where to put that code as well.. which file?
Thanks again!
I just made a page type with a customisable redirect URL.
Just extract, and upload RedirectForm.php to mysite/code/ then run db/build?flush=1
And since attaching didn't seem to work: http://simon.geek.nz/code/RedirectForm.tar.gz