I'm trying to make an application in windows phone 8 login functionality using php/my sql
i have following php script :
in my windows phone c# click event i wrote following things :
private void btnLogin_Click(System.Object sender, System.Windows.RoutedEventArgs e)
{
Uri uri = new Uri(url, UriKind.Absolute);
StringBuilder postData = new StringBuilder();
postData.AppendFormat("{0}={1}", "email", HttpUtility.UrlEncode("Test@test.com"));
postData.AppendFormat("&{0}={1}", "pwd1", HttpUtility.UrlEncode("password"));
WebClient client = default(WebClient);
client = new WebClient();
client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
client.Headers[HttpRequestHeader.ContentLength] = postData.Length.ToString();
client.UploadStringCompleted += client_UploadStringCompleted;
client.UploadProgressChanged += client_UploadProgressChanged;
client.UploadStringAsync(uri, "POST", postData.ToString());
prog = new ProgressIndicator();
prog.IsIndeterminate = true;
prog.IsVisible = true;
prog.Text = "Loading....";
SystemTray.SetProgressIndicator(this, prog);
}
private void client_UploadProgressChanged(object sender, UploadProgressChangedEventArgs e)
{
//Me.txtResult.Text = "Uploading.... " & e.ProgressPercentage & "%"
}
private void client_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
if (e.Cancelled == false & e.Error == null)
{
prog.IsVisible = false;
string[] result = e.Result.ToString().Split('|');
string strStatus = result[0].ToString();
string strMemberID = result[1].ToString();
string strError = result[2].ToString();
if (strStatus == "0")
{
MessageBox.Show(strError);
}
else
{
NavigationService.Navigate(new Uri("/DetailPage.xaml?sMemberID=" + strMemberID, UriKind.Relative));
}
}
}
i verfity the email and password is correct, in c# code, which i put, but in the end i always get message like this : e.Result = "Incorrect username or password"