Jump to content

PHP authentication on ODBC database --- please help


Recommended Posts

i am creating an intranet and also a newbie in PHP.  I have come up with the script below which I can use to retrieve a list of my users on the intranet.  Now how can I code in such a way that when a user enters the username and password my ODBC database gets to authenticate the user and grants or denies access to the intranet.  I have no problem creating a login window with username and password but what about integrating the code below with a php script that helps with the authentication.  PLiz help

 

<?php
   $db = odbc_connect("asaas","asas_user","asa") or die ("xxxxxxxxx");
   $sql = "SELECT id, username,password FROM logintest";
   $res = odbc_exec($db, $sql);

while ($row = odbc_fetch_array($res)) {
  print($row['id'].",".$row['username'].",".$row['password']."\n");

   }  
  
odbc_free_result($res);

odbc_close($db);
?>

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.