Skip to content

Instantly share code, notes, and snippets.

@cgilchrist
Created July 15, 2011 06:31
Show Gist options
  • Save cgilchrist/1084198 to your computer and use it in GitHub Desktop.
Save cgilchrist/1084198 to your computer and use it in GitHub Desktop.
Multi-step page Redirector
<?php
// Make sure the form in your first step has a hidden field named "next_url"
// which should be the location of step 2 landing page, something like:
// "http://promos.mydomain.com/multi-step-form-2"
$redirect_to = $_POST['next_url'];
foreach($_POST as $key=>$value) {
if ($key != 'pageId' && $key != 'pageVariant' && $key != 'next_url') {
$fields_string .= $key.'='.$value.'&';
}
}
rtrim($fields_string,"&");
$url = $redirect_to . '?' . $fields_string;
header('Location: '.$url);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment