Jump to content

Search the Community

Showing results for tags 'php mysql pdo'.

  • 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 all, I am wondering how to get this to work or if it is possible. I have an application that was not built with the admin having access to all the users account but now i want it to have access to all accounts. Thanks. (though i've not tried anything yet, just dont know how to start and i dont want to start afresh: advice) My current login code is: <?php if(isset($_POST['login'])){ $username = stripslashes($_POST['username']); $password = stripslashes($_POST['password']); $stmt = $pdo->prepare("SELECT password FROM tablename WHERE username=:username"); $stmt->bindValue(':username', $username, PDO::PARAM_STR); $stmt->execute(); if($stmt->rowCount()<1){ echo '<div class="signals"><p class="bg-warning text-center warning"><button type="button" class="close" aria-label="Close"><span aria-hidden="true">×</span></button>INVALID USERNAME OR PASSWORD</div></p>'; }else{ list($hash) = $stmt->fetch(PDO::FETCH_NUM); if (password_verify($password, $hash)) { //$_SESSION['username'] = $username; $status1 = "COMPLETED"; $status2 = "PROCESSING"; //$stmt = $pdo->query("SELECT status FROM ca_confirmed WHERE username ='$_SESSION[username]'"); $stmt = $pdo->query("SELECT status FROM tablename WHERE username ='$username'"); $check = $stmt->fetch(PDO::FETCH_ASSOC); $status = $check['status']; $_SESSION['username'] = $username; if(strcmp($status, $status1) == 0){ header("location: completed/index.php"); exit(); }elseif(strcmp($status, $status2) == 0){ header("location: uncompleted/index.php"); //exit(); } }else{ echo '<div class="signals"><p class="bg-warning text-center warning"><button type="button" class="close" aria-label="Close"><span aria-hidden="true">×</span></button>INVALID USERNAME OR PASSWORD again</div></p>'; } } } ?>
×
×
  • 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.