this is the first few lines of a page that inserts to the db. it is supposed to redirect, (and does) to thanks.php so that the refresh button wont add numerous records.
<? header("Location: thanks.php");
require('error.inc');
problem is, when header() is in there, the error.inc page doesnt work. this is error.inc:
$errors = 0;
function errortrap($num) {
die ("no. $num<BR>There was an error with the record submitted");
$errors = "1";
}
i also have problems using sessions or cookies with headers, and the page MUST redirect, and really needs to have the ability of sessions. the require('error.inc') could go if it has to, but it is more convenient to have it in an inc page because it is used by several pages.
what can i do to make shizz go smoother.