Here is a snippet of code that is going to be the death of me:
------------------------------------------------------------
// Create a new project
$projectcode = strtoupper(addslashes($_POST['projectcode'])); // project
code
// Make sure the project code is unique
if (!$existingproject = mysql_query("select * from pb_versions where
projectcode like '".strtoupper($projectcode)."'")) {
die ("Could not check for existing project code!<br />".mysql_error());
}
$numprojects = mysql_num_rows($existingproject);
if ($numprojects > 0) {
$pid = mysql_result($existingproject,0,"versionID");
header("Location:managebudget.php?e=1&pid=$pid");
}
------------------------------------------------------------
Now, even if $numprojects is 1, 2, 3, etc., the header() command is not
executed. Strangely, a header("Location") command later on in the script
*is* executed. I've output the value of $numprojects, so I know that it's
greater than 0, so the command
header("Location:managebudget.php?e=1&pid=$pid"); *should* be executed...
but it isn't. (Weirdly, if I put a die() command *after* this header()
command, it works... but it seems pathologically inelegant to do so.)
Obviously, I'm missing something incredibly basic. Can anyone help me figure
this out?
--
Richard S. Crawford ([email protected])
http://www.mossroot.com
Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)