Afficher un message
Vieux 14/03/2008, 17h15   #2
tedd
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] storing / processing login info (newbie stuff not intutorials)

At 8:01 AM -0700 3/14/08, good_times wrote:
>1. instead of typing: $conn=ocilogon("usrname","passwrd","db");
>can i save this info in a file and have my php script either include or call
>it when it needs to make a db connection? what would that look like? i may
>want to point my app to a test db at some point & it would be nice to only
>change it in one place.


Use:

include('config.php');

Where:

$usrname = 'username';
$passwrd = 'password';
$db = 'mydB';

In your script

include('config.php');
$conn=ocilogon($usrname,$passwrd,$db);



>2. i see an example where a form in a login.html submits to "authcheck.php"
>but authcheck.php just prints ('User not found in LDAP' or 'error occured'
>or 'success'). how can authcheck.php redirect the user to... say.. BACK to
>the login.html and tell it "yes or no" and then have login.html either
>direct the user to a different data entry page (if the login was good), or
>display "sorry, try again" - all from the 1 form's "submit"


If ($auth != true)
{
header('Location: http://www.example.com/login.html');
}

It's all in the manuals.

Cheers,

tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
  Réponse avec citation
 
Page generated in 0,04944 seconds with 9 queries