I want to have a custom redirection with PHP values

Status
Not open for further replies.

AlexTCGPro

Member
Hey guys. I'm trying to have a redirect after a value gets submitted / edited but not to a specific url but a dynamically generated one. I tried the redirect plugin but that one doesn't seem to allow for custom php code and the php plugin itself, but I tried on BeforeCalculations and AfterProcess and neither did anything, could you give me a hand?
This is the code I'm working with:
Code:
$first_h = $_GET['first_h'];
$second_h = $_GET['second_h'];
$url = "/coding/test-1?first_h=" . $first_h. "&second_h=" . $second_h;
// return '<script>windows.location = ' . $url . '; console.log("Success!")</script>';
return header('Location: '. $url, true, 302);
die();
I tried with both javascript and PHP but nothing happens.

EDIT: Nevermind, the issue was with adding 'return' before the header code, solved!
 
Last edited:
Status
Not open for further replies.

Members online

No members online now.
Back
Top