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!