Forums

Custom redirect for each user

raygold 04 Mar, 2011
I'd like to know if is possible redirect each user to a custom page after he submit the form.
For example in the message after submit I insert "www.mysite.com/{field name}",where {field name} is the name that user choose for his custom page.
Finally,Can I make this dynamic url "www.mysite.com/{field name}" an active link?
Or is there an alternative solution to redirect user according what he add in the {field name} item?
GreyHead 04 Mar, 2011
Hi raygold,

Do you want to redirect the user or to show the user a link from the Thank You page? Both are possible, the second one is simple enough, it will be something like:
<a href'http://www.mysite.com/{field name}'>click here</a>


Bob
raygold 04 Mar, 2011
If possible,I'd like redirect user to a custom page depending which he add in the {field name} item.
Example: User add mypage in text box of {field name} and after submit he is redirected to http://www.mysite.com/mypage
GreyHead 04 Mar, 2011
Hi raygold,

Then please try:
<?php
$mypage = JRequest::getString('some_input_name', '', 'post');
$MyForm->formrow->redirecturl = 'http://www.mysite.com/'.$mypage;
?>

Bob
raygold 04 Mar, 2011
Maybe I don't explain good,"mypage" is only an example value,after http://www.mysite.com/.
I'd like user will be redirected accordig to data he has added in the field.

If user add mypage1 in the field name,he should be redirected to http://www.mysite.com/mypage/
If user add mypage2 in the field name,he should be redirected to http://www.mysite.com/mypage2/
GreyHead 04 Mar, 2011
Hi raygold,

Yes, exactly, that's what the code I've posted does.

Bob
raygold 04 Mar, 2011
I should add this code in On Submit code - after sending email?
GreyHead 04 Mar, 2011
Hi raygold,

Yes; and you need to replace some_input_name with the name of the form input where they've entered the 'mypage' string.

Bob
raygold 04 Mar, 2011
Thank you very much.
Last question:Is there a way to reset Form id?
I have created two forms,except forms that I have deleted,but everytime I create a new form,id numbers grow progressively.
GreyHead 04 Mar, 2011
Hi raygold,

Technically it's possible by digging around in the database tables but I'd just ignore it. The ids are rarely referred to anywhere except inside the ChronoForms code.

Bob
raygold 04 Mar, 2011
Ok,Thanks again.
This topic is locked and no more replies can be posted.