Jump to content

Search the Community

Showing results for tags 'php pdo loginform'.

  • 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. recently i changed my password for my mysql DB and after that the class method for the login form seems to be not working pl help me. And it doesn't throw up any errors too. the code in dbconfig.inc.php where the class is initiated is as follows: <?php session_start(); $host="localhost"; $dbName="project"; $dbUname="root"; $dbPass="*****"; try { $conn=new PDO("mysql: host=$host;dbname=$dbName; charset=utf8", $dbUname, $dbPass); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { $e->getMessage(); } require_once 'classes.inc.php'; $project= new projecteg($conn); the login logic script page is as follows:(i tried to var_dump user its not working) <?php include_once 'dbconfig.inc.php'; if (isset($_POST['submit-login'])) { $uname= htmlentities($_POST['unamel']); $unamel= stripslashes($uname); echo "$unamel"; $pass= htmlentities($_POST['passl']); $pass1= stripslashes($pass); echo $pass1; $passl= md5($pass1); $user = $project->viewProtectedArea($unamel,$passl); print_r($user); if (isset($user)) { $_SESSION['id']=$user['user_id']; $_SESSION['fname']=$user['fname']; $_SESSION['lname']=$user['lname']; $_SESSION['uname']=$user['uname']; $_SESSION['email']=$user['email']; $_SESSION['phone']=$user['phone']; $_SESSION['app']=TRUE; $user_ok=TRUE; header("location: ../home.php?u={$_SESSION['uname']}"); } else { header("location: ../index.php?nosession"); } } /* if (isset($_SESSION['app'])&&$_SESSION['uname']!="") { header("location: ../home.php?u=".$_SESSION['uname']); } else { header("location: ../index.php?usernotfound?id=017"); } */ the class method logic is as follows: public function viewProtectedArea($unamel,$passl) { try { $active='1'; $stmth= $this->_db->prepare("select * from user where uname=:uname and pass=:pass and activated={$active}"); $stmth->bindparam(":uname",$unamel); $stmth->bindparam(":pass",$passl); $stmth->execute(); return $stmth->fetch(PDO::FETCH_ASSOC); } catch (PDOException $exc) { $exc->getMessage(); return false; } }
×
×
  • 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.