单击按钮时如何在另一个页面上显示按钮名称 [英] How to display button name on another page when button is clicked

查看:44
本文介绍了单击按钮时如何在另一个页面上显示按钮名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在单击按钮时在另一个页面上显示按钮的名称.例如:

I'm trying to display the name of a button on another page when a button is clicked. For example:

<a href="#" class="btn btn-danger btn-lg btn-block"> <?php echo $sql->name; ?></a>

echo $sql->name 显示两个按钮,如.我想让按钮的名称出现在下一页.例如,如果一个按钮是数学",另一个是英语".当我点击数学时,下一页应该有数学作为标题.我避免手动执行此操作.

The echo $sql->name displays two buttons like. I want to make the names of the buttons appear on the next page. For instance, if a button is 'Maths' and another, 'English'. When I click on Maths, the next page should have Maths as a heading. I'm avoiding manually doing it.

提前致谢.

推荐答案

试试这个

    <a href="your_page.php?button=maths" class="btn btn-danger btn-lg btn-block">Maths</a>
<a href="your_page.php?button=english" class="btn btn-danger btn-lg btn-block">Maths</a>

在 your_page.php 上,您可以通过以下命令轻松获取按下了哪个按钮

on your_page.php you can easily get which button is pressed by the following command

$pressedButton = $_REQUEST['button'];
echo $pressedbutton;

这篇关于单击按钮时如何在另一个页面上显示按钮名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆