I have a form on a page to submit a comment, and once a user places a comment I would like it to reload the page.
This is what I got
$insertGoTo = "employer.php?employer=" . $row_employer_page['employer'] . "";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
It works, however I got this error on submit.
Notice: Undefined variable: row_employer_page in /u/students/m/*******/public_html/cis231/project/employer.php on line 51
Warning: Cannot modify header information - headers already sent by (output started at /u/students/m/*******/public_html/cis231/project/employer.php:51) in /u/students/m/*******/public_html/cis231/project/employer.php on line 56
The lines it references are the code I posted above. I'm not sure what's going on, it reload the page how I want but throws that error