rahul_jjj Posted November 29, 2008 Share Posted November 29, 2008 I need to do a login validation in my php script. Can anyone advise how to implement the same. Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted November 29, 2008 Share Posted November 29, 2008 You might be better asking in a javascript forum. That's where Ajax is actually implemented, even though it may be calling PHP scripts to retrieve data or similar. Quote Link to comment Share on other sites More sharing options...
omarh2005 Posted November 29, 2008 Share Posted November 29, 2008 use such this $q = "SELECT * FROM `users` WHERE `username` = '".$_POST['name']."' and `password` = '".$_POST['password']."';"; $s = mysql_query($q) or die("error selecting"); $a = mysql_fetch_array($s); if($a['username']){ $name = $a['username']; $grant = $a['grant']; session_register('name'); session_register('grant'); header("Location:main.php"); }else{ header("Location:index.php"); } Quote Link to comment Share on other sites More sharing options...
bzz Posted November 29, 2008 Share Posted November 29, 2008 The whole point of using ajax is to avoid page reloads and minimize data transfer... I had a very simple ajax login I used to use on my website... I have no idea where it is now. I'm useless. Quote Link to comment Share on other sites More sharing options...
rahul_jjj Posted December 1, 2008 Author Share Posted December 1, 2008 Can anyone post the code for login validation through Ajax in php Quote Link to comment Share on other sites More sharing options...
trq Posted December 1, 2008 Share Posted December 1, 2008 This board is for help with your problematic code. Its not a place to request tutorials or code snippets. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.