dongpi2503 2014-02-13 17:36
浏览 33

C#PHP通信

I'm writing an app that will authenticate user from a MySQL database. I have written it in Java (android) but am now porting to Windows phone.

the PHP file uses $get and then echoes the response:

$localhost = mysql_connect($hostname_localhost,$username_localhost,$password_localhost)
or
trigger_error(mysql_error(),E_USER_ERROR);

mysql_select_db($database_localhost, $localhost);

$username = $_POST['username'];

$query_search = "select * from users where user = '".$username."'";
//$query_search = "select * from users where username = '".$username."' AND password     = '".$password. "'";

$query_exec = mysql_query($query_search) or die(mysql_error());
$rows = mysql_num_rows($query_exec);
//echo $rows;
if($rows == 0) {
echo "No Such User Found";
} else  {
    echo "User Found";
}

How can I pass the username variable to PHP and then receive the result?

  • 写回答

2条回答 默认 最新

  • dqfsbvd43312 2014-02-13 18:51
    关注

    use a in-linky stuff like I have a script in my server and you just write: "example.com/save.php?username=textbox1.text&score=points"

    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效