Jump to content

disabling oracle warning??


nvidia

Recommended Posts

Hi i have a form called login.html where i enter my username and password to connect to my oracle db. I click the submit button and it will go to my memberlogin.php. If i have entered my details correctly a form should appear to enter data in my text field. If however i have not entered it correctly it should say "Sorry could not connect to database". I have a few question needing asking please: If i have not entered my details correctly i want my error message to appear. However, when i enter it incorrrectly i get the message:

 

Warning: ocilogon(): OCISessionBegin: ORA-01005: null password given; logon denied in /home/eland/u1/kbccs/w1009048/public_html/RAD/C2/memberlogin.php on line 20 
Sorry, could not connect to the database

 

combined with my message. How can i therefore disable my warning?

 

Secondly, if it is wrong a link to the the login.hml should appear but it does not only the "Sorry, could not connect to the database". Can somone tell me why it is not appearing?

 

Last but not least, if it is correct, how do i change my code to incorporate the form section, if not the above error message i have written should appear.

 

login.html


<html>
<head>
  <title> Login To Oracle </title>
</head>
<body>
<form action="memberlogin.php" method="POST">
   Please enter your username: <br>
   <input type="text" name="txtus" value=" " /> <br>
   Please enter your password: <br />
    <input type="password" name="txtps" value=" " /> <br>
    <input type="submit" name="submit" value="submit" /> <br>
    Note: This will allow you to connect to your oracle database. 
</form>
</body>
</html>

 

memberlogin.php


<html>
<head>
  <title>  Member Login Page</title>
</head>
<body>
  <?php
session_name('memebersession');
session_start();
// create session variables

  $_SESSION['psswd'] = $_POST['txtps'];
  $_SESSION['usn'] = $_POST['txtus'];
  $_SESSION['db'] = '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)
                        (HOST = squirrel.wmin.ac.uk)(PORT = 1521))
                        (CONNECT_DATA = (SID = ORA8)(SERVER = DEDICATED)))';

   // connect using session variables
$c= OCILogon($_SESSION['usn'], $_SESSION['psswd'], $_SESSION['db']);
if (!$c):
           Exit ("Sorry, could not connect to the database");
           OCILogoff($c);
          echo "<li><a href=login.html> Back to login </a></li>";

endif;

?>

<form action="custretrieval.php method="POST" >
   <b> Enter customer id to search: </b> <br>

  <input type="text" name="memberid" value=" " /> <br>
  <input type="submit" name="submit" value="Search" />
</form>
</body>

 

Your suggestions would be appreciated thanks.

Link to comment
https://forums.phpfreaks.com/topic/43731-disabling-oracle-warning/
Share on other sites

I have partly solved my problem. The only thing i want to know is how to disable the oracle message

 

Warning: ocilogon(): OCISessionBegin: ORA-01017: invalid username/password; logon denied in /home/eland/u1/kbccs/w1009048/public_html/RAD/C2/memberlogin.php on line 18

 

I have my own message that i can display "Sorry but cannnot connect to database" but unsure how to disable the warning. Anyone knows how to do this??

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.