Jump to content

PHP & Oracle help


gerop

Recommended Posts

Hi All,I'm trying to use HTML and PHP to create a web page where users can update their oracle database password when it expires (Our application doesn't come with an option to change passwords and the users need to contact the DBA each time). I'm testing with odbc_connect, but I don't know how to handle it when the password is expired and oracle prompts for a new password "ORA-28001: the password has expired" . How can I return the error message to user and update the password pls? I tried using odbc_errormsg but it doesn't seem to capture the error. I'm still ver new to PHP , so pls help.Thanks Rgds,Geraldine

Link to comment
Share on other sites

First, you need a password that you can connect with that does not expire. If you're trying to connect with an expired password then obviously you won't be able to, so you need a password that does not expire that PHP can use to connect to Oracle to change the user's password. The reference for odbc_errormsg has this note on it:

This function returns meaningful value only if last odbc query failed (i.e. odbc_exec() returned FALSE).
I don't know how to recover an error message generated from odbc_connect, but it will return 0 if it fails. Make sure that error messages are being displayed as well, it might automatically show the error.Once you're connected, to send the command to change the password to Oracle you will use odbc_exec. I haven't used Oracle, so I'm not sure what the statement is to change a user's password, you'll probably want to ask the DBA that.http://www.php.net/manual/en/function.odbc-exec.php
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...