Jump to content

Search the Community

Showing results for tags 'login does not work'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

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

Found 1 result

  1. Hey PW people! I made a custom login form which sends a request to an AJAX page that should log me in, I'll post the scripts in a second. But I'd get a weird error of some sort. This is what I do I log in on my login form (/user/login) It logs me in, session is created and everything I go to the homepage -> i log out -> i go back to the login page and i login again, this is where i can't login i get a message "Incorrect password and username"(my custom message which is returned at a NULL return which means it fails right?! So these are my scripts Login.php: <?php if(!$user->isLoggedin()) { ?> <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#login").click(function(){ $("#ajax").html("Laden..."); $.ajax({ url: '/site/ajax/ajaxResponder.php', type: 'post', dataType: 'JSON', data: { 'action': 'login', 'username': $("#username").val(), 'password': $("#password").val() }, success:function(data){ alert(data.pass); if(data.status) { window.location = "/"; } $("#ajax").html(data.message); } }); return false; }); }); </script> <?php ?> <form action ="" method="post"> <label for="username">Gebruikersnaam:</label> <input type="text" name="username" id="username" /> <label for="password">Wachtwoord:</label> <input type="password" name="password" id="password" /> <input type="submit" value="Login" id="login"/> </form> <div id="ajax"></div> <?php } else { echo 'Je bent ingelogt.<br /><a href="/user/logout">Log uit</a>'; } ?> This is ajaxResponder (the part that matters, the case in a switch $_POST['action'])(/site/ajax/ajaxResponder.php) case 'login': $pass = $_POST['password']; $user = $_POST['username']; $r = wire('session')->login($user, $pass); if($r) { $re['message'] = 'U bent ingelogd'; $re['status'] = true; } else { $re['message'] = 'Uw gebruikersnaam of wachtwoord is onjuist'; $re['status'] = false; } echo json_encode($re); break; So what can I do to fix this problem? Kind regards, Harm.
×
×
  • Create New...