Heim > Artikel > Backend-Entwicklung > php里面 button 怎么传值?
<input type="button" name="button" value="审核" style="width:80px; height:25px; cursor:pointer;" onMouseMove= "this.style.background= '#e1d4c7'" onMouseOut= "this.style.background= ''" onclick="window.location.href='gzd_manage_select_list.php?Gid=<?=$Gid;?>'" />
这不是已经传了吗?url带参数
echo $_GET['Gid'];
这不是已经传了吗?url带参数
没有啊,在gzd_manage_select_list.php页面没有得到值?
echo $_GET['Gid'];
这个是在gzd_manage_select_list.php页面写就会有值啦嘛,可是我这边却没有值啊?
当前页面 echo $Gid; 有值吗
<input type="button" name="button" value="审核" style="width:80px; height:25px; cursor:pointer;" onMouseMove= "this.style.background= '#e1d4c7'" onMouseOut= "this.style.background= ''" onclick="window.location.href='gzd_manage_select_list.php?Gid=<?echo $Gid;?>'" />
还是需要标签,用get或者post就可以了
gzd_manage_select_list.php 页面里写
if (!empty($_GET['Gid'])){ //如果 Gid 不为空 $Gid = $_GET['Gid']; //设置变量$Gid 的值为传过来的Gid值 echo $Gid; //如果赋值成功,会有值输出}