高手进来看看这个mysql怎么注入

Megadeth 2005-04-01 12:00:33
代码在这里了:
link_data();
$query1="select choice from title where id=".$HTTP_GET_VARS["id"]."";
$result1=mysql_query($query1);
$row1=mysql_fetch_array($result1);
$my=$HTTP_POST_VARS["choice"];
if ($row1["choice"]=="a")
{
$query="update choice set num=num+1 where id=".$my;
$result=mysql_query($query);
session_register("votes");
echo "<script language='javascript'>alert('投票成功!');window.close();</script>";
}
elseif ($row1["choice"]=="b")
{
for ($i=0;$i<count($my);$i++)
{
$query="update choice set num=num+1 where id=".$my[$i];
$result=mysql_query($query);
session_register("votes");
}
echo "<script language='javascript'>alert('投票成功!');history.go(-1);</script>";
}

我要构造怎样的url来搞定他
...全文
145 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
-神仙- 2005-04-01
  • 打赏
  • 举报
回复
我是说最后的.""
pswdf 2005-04-01
  • 打赏
  • 举报
回复
"select choice from title where id=".$HTTP_GET_VARS["id"]."";

也有可能是PHP3过来的呀

你可以URL后面加上: ?ad='1=1'
或者POST,构架一个表单
fyxw 2005-04-01
  • 打赏
  • 举报
回复
呵呵!ASP过来的……
-神仙- 2005-04-01
  • 打赏
  • 举报
回复
"select choice from title where id=".$HTTP_GET_VARS["id"]."";
一看就是原来学asp的写的
破法者 2005-04-01
  • 打赏
  • 举报
回复
我菜,不知道
zairwolfd 2005-04-01
  • 打赏
  • 举报
回复
nod
ice_berg16 2005-04-01
  • 打赏
  • 举报
回复
不厚道..

21,891

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧