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. Link to comment https://forums.phpfreaks.com/topic/134730-how-to-implement-ajax-in-php/ 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. Link to comment https://forums.phpfreaks.com/topic/134730-how-to-implement-ajax-in-php/#findComment-701612 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"); } Link to comment https://forums.phpfreaks.com/topic/134730-how-to-implement-ajax-in-php/#findComment-701622 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. Link to comment https://forums.phpfreaks.com/topic/134730-how-to-implement-ajax-in-php/#findComment-701625 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 Link to comment https://forums.phpfreaks.com/topic/134730-how-to-implement-ajax-in-php/#findComment-702982 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. Link to comment https://forums.phpfreaks.com/topic/134730-how-to-implement-ajax-in-php/#findComment-703001 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.