dongyukui8330 2015-09-23 23:11
浏览 34

Javascript停止帧上的字符[重复]

I created a small PHP to redirect to a page after stripping the referer. It works pretty consistent around browsers, however, it redirects to the wrong url.

<script>  
window.frames[0].document.body.innerHTML='<form target="_parent" action="http://www.example.com/send.php?year=2015&email=me%40me.com&submit=send+form"></form>';
window.frames[0].document.forms[0].submit()
}    
</script>

<iframe onload="window.setTimeout('go()', 99)" src="about:blank" style="visibility:hidden"></iframe>

Rather than taking me to http://www.example.com/send.php? year=2015&email=me%40me.com&submit=send+form it takes me to http://www.example.com/send.php?

So basically the ? acts like a stop word. How could it fix it? Any help would be GREATELY appreciated.

</div>
  • 写回答

1条回答 默认 最新

  • dongluedeng1524 2015-09-23 23:26
    关注

    Don't put ? and parameters in form actions. Put them in <input type='hidden'/>s.

    window.frames[0].document.body.innerHTML="<form target='_parent' action='http://www.example.com/send.php' method='get'><input type='hidden' name='year' value='2015'/><input type='hidden' name='email' value='me@me.com'/><input type='hidden' name='submit' value='send form'/></form>";
    
    评论

报告相同问题?

悬赏问题

  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大