Jump to content

Search the Community

Showing results for tags 'password form encryption'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi, I recently just created a test site to see what I can produce and everything is working fine apart from the login form. Here's the code I have. <?php session_start(); // dBase file include "dbConfig.php"; if ($_GET["op"] == "fail") { echo "<ul><li><h1 class='FailLoginState'>You need to be logged in to access the members area!</h1></li></ul>"; } if ($_GET["op"] == "login") { if (!$_POST["username"] || !$_POST["password"]) { die("You need to provide a username and password."); } // Create query $q = "SELECT * FROM `TABLENAMEHERE` " ."WHERE `username`='".$_POST["username"]."' " ."AND `password`='".$_POST["password"]."' " ."LIMIT 1"; // Run query $r = mysql_query($q); if ( $obj = @mysql_fetch_object($r) ) { // Login good, create session variables $_SESSION["valid_id"] = $obj->id; $_SESSION["valid_user"] = $_POST["username"]; $_SESSION["valid_time"] = time(); // Redirect to member page Header("Location: members.php"); } else { // Login not successful echo '<form action="?op=login" method="POST">'; echo 'Username:<br><input class="InputForm" type="text" name="username" id="username"><br>'; echo '<br>'; echo 'Password:<br><input class="InputForm" type="password" name="password" id="password"><br>'; echo '<br>'; echo '<button type="submit" name="submit" class="InputButton" value="Login">Submit</button>'; echo '</form>'; echo '<ul><li></li></ul>'; echo("<h1 class='FailLoginState'>Sorry, couldn't log you in. Wrong login information.</h1>"); } } else { echo '<form action="?op=login" method="POST">'; echo 'Username:<br><input class="InputForm" type="text" name="username" id="username"><br>'; echo '<br>'; echo 'Password:<br><input class="InputForm" type="password" name="password" id="password"><br>'; echo '<br>'; echo '<button type="submit" name="submit" class="InputButton" value="Login">Submit</button>'; echo '</form>'; } ?> If they're any bugs or something that looks weird in there it's because I'm new to PHP The problem mainly is when the client trys to log in after registering they can't because when they register it encrypts their password with MD5 encryption so when they go to log in, it comes up with the "Incorrect information" error. How do I make it so that it reads that password from the database? Thanks.
×
×
  • 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.