Thread: login

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2017
    Posts
    5
    Rep Power
    0

    Exclamation login


    how i login in php through oracle database. please experts help me in login form php through oracle perfect code
    <?php
    $username = $_POST["username"];
    $password = $_POST["password"];
    $con = oci_connect("user","pswrd","db");
    if(! $con)
    {
    die('Connection Failed'.oci_error());
    }
    $query = "SELECT username, password FROM users
    WHERE username=$username";
    $stmt = oci_parse($conn, $query);
    $row = oci_fetch_array($stmt, OCI_NUM);;
    if($row["username"]==$username && $row["password"]==$password)
    echo"You are a validated user.";
    else
    echo"Sorry, your credentials are not valid, Please try again.";
    ?>

    and my html code is here...

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>form</title>
    </head>
    <body>
    <form method="post" action="login.php" >
    <table border="1" >
    <tr>
    <td><label for="username">username</label></td>
    <td><input type="text"

    name="username" id="username"></td>
    </tr>
    <tr>
    <td><label for="password">Password</label></td>
    <td><input name="password"

    type="password" id="password"></input></td>
    </tr>
    <tr>
    <td><input type="submit" value="Submit"/>
    <td><input type="reset" value="Reset"/>
    </tr>
    </table>
    </form>
    </body>
    </html>
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Location
    Lithuania
    Posts
    32
    Rep Power
    1
    Hi,

    First of all, please use code tags when posting code snippets, it will make your code easier to read, so you will get more responses.

    Secondly, please write what exact issues you experience, so we can assist you better.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,391
    Rep Power
    631
    Actually you should use PHP tags rather than CODE tags. CODE tags are more appropriate for non-PHP code. See the sticky at the top of this forum that says READ THIS BEFORE POSTING.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.

IMN logo majestic logo threadwatch logo seochat tools logo