Link to home
Start Free TrialLog in
Avatar of dereksheahan
dereksheahan

asked on

After Insert Goto Problem

Hi all,
I have a page with an insert to DB setup and after inserting I want it to go to a different page. I've tried inserting this code to the end of the statement (as I checked what the dreamweaver wizard created when I tested it on a different page).

$insertGoTo = "thankyoufeedback.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));

But now when I try to click on a link to this page, it bypasses this page and takes me straight to the "thankyoufeedback.php page. How can I fix this?
Thanks,
D
ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dereksheahan
dereksheahan

ASKER

Great! Thanks Roonaan