The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.28 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.28 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.28 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.28 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.28 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.28 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.28 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Redirecting to different “Thank You!” pages using process.php - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Redirecting to different “Thank You!” pages using process.php (/showthread.php?tid=762)



Redirecting to different “Thank You!” pages using process.php - michael.ka - Jun 28th, 2010

Is there a way of redirecting to different (localized) “Thank You!” pages, depending on the (localized) form the user was visiting?


RE: Redirecting to different “Thank You!” pages using process.php - michael.ka - Jun 29th, 2010

A little update: I’m quite proud that I figured out how to solve my problem completely on my own, without any knowledge of PHP. Here is what works (for anyone who might want to solve a similar problem in the future):

You first need to install a module, the Submission Pre-Parser.

Create a new rule and select the form(s) where you want to work your redirect magic. All you need to do next is add one line of PHP code:

PHP Code:
$_POST["form_tools_redirect_url"] = "http://redirect-url/"

You need to replace "http://redirect-url/" on the right side with the URL you want to redirect to. "http://google.com" would, for example, redirect to Google after the form was submitted.

What I did was add a hidden input field to my (localized) form with the (localized) redirect URL as the value, like so:

Code:
<input type="hidden" name="redirect" value="http://redirect-url/" />

You again have to replace "http://redirect-url/" with the URL you want to redirect to.

To make this work you have to slightly change the PHP code of your Pre-Parser rule, like so:

PHP Code:
$_POST["form_tools_redirect_url"] = $_POST["redirect"]; 

$_POST["redirect"] grabs the value of your input field with the name "redirect" – the one I inserted before.

That already works, even if you forget to insert a hidden field. The user is then just redirected to the default Thanks! page. I’m not sure why that is the case (since I don’t know anything about PHP). I would think that you would have to add a check whether or not that hidden redirect form field exists, like so:

PHP Code:
if (!empty($_POST["redirect"]))
  
$_POST["form_tools_redirect_url"] = $_POST["redirect"]; 

That doesn’t break anything but it also doesn’t change anything. It would be nice if someone could tell me what I should use. I took a peek at process.php and it seems to me as though that same check is done there, too, so mine might be redundant. As I said before, I don’t know anything about PHP, I’m happy about all corrections.

Thanks, by the way, for this awesome tool which fits our bill so completely, it’s unbelievable. A incredibly well-thought-out tool!