网上问题大多是 到底带不带&号
我不管带不带,都返回用户不存在(浏览器直接填入能正确返回),代码如下<?php
include("conn.php");header("Content-type:text/html;charset=UTF-8");
$userid=trim($_GET["userid"]);
$conn=mysql_open();
$sql="select * from zh_userdata where USERID='$userid'";
$query=mysql_query($sql);
$result=mysql_fetch_array($query);if ($result!=""){
echo $result[USERID];
}
else
{
echo '用户不存在';
}
mysql_close($conn);
?>function ADAX_Login(userid, userpw: string): string;
var
LoginInfo, Response:TStringStream;
IdHTTP: TIdHTTP;
begin
try
Response := TStringStream.Create('');
LoginInfo := TStringStream.Create(''); //StringList试过了也不行
IdHTTP := TIdHTTP.Create(Application);
LoginInfo.WriteString('userid='+userid);
IdHTTP.request.contenttype:='application/x-www-form-urlencoded';
try
IdHTTP.Post('http://localhost/register/test.php',LoginInfo,Response);
except
ShowMessage('连接服务器失败');
Exit;
end;
Result := Response.DataString;
finally
LoginInfo.Free;
Response.Free;
IdHTTP.Free;
end;
end;另外请教有没有不用echo返回的方法?太不安全了
我不管带不带,都返回用户不存在(浏览器直接填入能正确返回),代码如下<?php
include("conn.php");header("Content-type:text/html;charset=UTF-8");
$userid=trim($_GET["userid"]);
$conn=mysql_open();
$sql="select * from zh_userdata where USERID='$userid'";
$query=mysql_query($sql);
$result=mysql_fetch_array($query);if ($result!=""){
echo $result[USERID];
}
else
{
echo '用户不存在';
}
mysql_close($conn);
?>function ADAX_Login(userid, userpw: string): string;
var
LoginInfo, Response:TStringStream;
IdHTTP: TIdHTTP;
begin
try
Response := TStringStream.Create('');
LoginInfo := TStringStream.Create(''); //StringList试过了也不行
IdHTTP := TIdHTTP.Create(Application);
LoginInfo.WriteString('userid='+userid);
IdHTTP.request.contenttype:='application/x-www-form-urlencoded';
try
IdHTTP.Post('http://localhost/register/test.php',LoginInfo,Response);
except
ShowMessage('连接服务器失败');
Exit;
end;
Result := Response.DataString;
finally
LoginInfo.Free;
Response.Free;
IdHTTP.Free;
end;
end;另外请教有没有不用echo返回的方法?太不安全了
解决方案 »
- 一维转二维,导出EXCEL
- 为什么我的delphi6在win2000 professional上无法安装?
- Delohi中有没有统计一段代码执行时间的函数?马上结帖
- 怎样从数据库中导出文本,又将文本导入数据库?
- 编译完了在没有Delphi的机器上运行提示找不到文件:qtintf.dll,我该怎么办?
- 一个小问题求助
- 还有400分未发,欢迎继续讨论应用软件应该如何规划窗口界面。入者有分
- 高分,请问谁知道access的密码,请看我的贴子
- 请教彩搜索提取号码的问题
- 图片比较大时,用serversocket.sockt.sendbuf(buf, sizeof(stream))如何传送?
- excelapplication有什么好的方法可以获取当前表格当前工作簿有多少行记录??
- 寻求编程思路,好思路有高分
用WPE看看,参数是第二次单独send,没连在xxx/test.php后面,难道参数不是这样传的?我看网上代码都是这样啊
直接POST'test.php?userid='+userid的话,感觉方式太丑了
不过你也可以用AES,DES加密啊
网上 这样的例子应该挺多的