php+js实现重定向跳转并post传参

页面重定向跳转并post传参

$mdata=json_encode($mdata);//如果是字符串无需使用json
echo " <form style='display:none;' id='form1' name='form1' method='post' action='reward?sys={$this->mdata['sys']} ' >
<input name='mdata' type='text' value='{$mdata}' />
</form>
<script type='text/javascript'>function load_submit(){document.form1.submit()}load_submit();</script>";

 或者

echo "<form style='display:none;' id='form1' name='form1' method='post' action='{$url}'>
<input name='qb_username' type='text' value='{$arr["qb_username"]}' />
<input name='service' type='text' value='{$arr["service"]}'/>
<input name='require_time' type='text' value='{$arr["require_time"]}'/>
<input name='callbackurl' type='text' value='{$arr["callbackurl"]}'/>
<input name='sign' type='text' value='{$arr["sign"]}'/>
<input name='partner_no' type='text' value='{$arr["partner_no"]}'/>
</form>
<script type='text/javascript'>function load_submit(){document.form1.submit()}load_submit();</script>";

posted on 2018-05-28 14:19  zqifa  阅读(2780)  评论(0编辑  收藏  举报

导航