Ok, I have a problem with the header() redirect function, below is the
part-code/part-pseudocode information. The file that this code is
encapsulated in is a single file named add_item.php. There is no output
before the header() function. Now this is a weird one, but I did some
testing and here is what happens:

If there are no rows returned, redirect browser to the same page with some
needed get variables. The problem is with the submit_cat=1 get variable
attached to the URL-to-be-redirected. When I take this out of the get
string, the script redirects the user just fine when the value of
$num_rows=0. I still need that variable to be sent so when I place the
submit_cat=1 variable back into the get string it takes you to the default
Apache error page entitled, "Internal Server Error". Why is this submit_cat
variable causing me so much trouble?

<?php

if (this) {
        .
        .
        .
} elseif (something) {
        .
        .
        .
} elseif (something_else) {

   if ($num_rows == 0) {
       header("Location:
$PHP_SELF?submit_cat=1&submit_subcat=1&cat_id=$cat_id");
       exit;
   } elseif ($num_rows != 0) {
       $row = $db->fetch_results($query);
        .
        .
        .
   }
}

?>

- Nilaab


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to