如何将值传递到其他页面 [英] How to Pass a value to an other page

查看:110
本文介绍了如何将值传递到其他页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个PHP页面.第一页(records.php)在表中具有1000个值.每个值都有一个编辑"按钮.当某些用户单击编辑"按钮时,我想将有关的值传递给另一页(edit.php).

如何执行此操作?

注意:(我需要通过POST方法传递值),该怎么办?

I have two PHP pages. the first page (records.php) has the 1000 values in a table. Each value has an Edit Button. I want to pass the concerned value to the other page (edit.php) when some user click on the Edit button.

How can I perform this action?

Note:( I need to pass the value through POST method), How can I do that?

推荐答案

将相关值存储在变量中,像这样创建锚点

Store concerned value in a variable, Make anchor like this

<a href="edit.php?id=".


变量


并且在edit.php上,您可以通过此
获得此值




and on edit.php you can get this value by this


_GET [" span>]))
_GET["id"]))



如果使用Post方法,则必须制作
之类的表格



In case of Post method you''ll have to make form like

<form method="post" action="?php echo


这篇关于如何将值传递到其他页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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