Problem related to OCILogon ()

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


   My objective is to try to connect to the oracle database and if an
error occurs go to another page. The code follows

 $conn = OCILogon($user,$passwd,$db);   // <---- Line 34

 if (!$conn) {
    $err = OCIError();
    header("Location: dbproblem.php?error=$err[text]");

    The problem is, whenever the OCILogon() fails, I'm not able to
redirect to dbproblem.php because OCILogon has already sent the error
message to the client, thus resulting in the following message

Warning: Cannot modify header information - headers already sent by
(output started at /path/to/validate.php:34)

    Is there anyway that I can stop OCILogon() from sending the error?

Re: Problem related to OCILogon ()


$conn = @OCILogin($user,$passwd,$db);

The @ symbol before a function call suppresses any error messages the
function might return to the client.

Site Timeline