jon-e2 Posted August 4, 2011 Share Posted August 4, 2011 Im trying to work up a way to have a login form off a separate page, I don't want this to just send users to the dologin.php I want it to validate it with ajax. I don't work with xml often so I'm just hoping to get some feedback or if anyone knows of examples that are currently doing this let me know. currently here is our php file we are having a form post to. <?php $femail = $_POST['femail']; $fpassword = $_POST['fpassword']; $api_endpoint = '../includes/api.php'; $api_user = '[i]user[/i]'; $api_password = [i]pass[/i]'; $user_email = $femail; $user_password = $fpassword; $data = array( 'username' => $api_user, 'password' => md5($api_password), 'action' => 'validatelogin', 'email' => urlencode($user_email), 'password2' => $user_password, ); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $api_endpoint); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_TIMEOUT, 100); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); $response = curl_exec($curl); curl_close($curl); echo $response; echo $femail; echo $fpassword; ?> any input or thoughts would but very much appreciated! 0 Quote Link to comment Share on other sites More sharing options...
jon-e2 Posted August 4, 2011 Author Share Posted August 4, 2011 figured it out! Thanks anyway 0 Quote Link to comment Share on other sites More sharing options...
mikejs Posted August 5, 2011 Share Posted August 5, 2011 Care to share 0 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.