ahref链接动态数据 [英] ahref link with dynamic data
本文介绍了ahref链接动态数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好 -
试图获取一个链接,通过url从php中的mysql查询将值传递给另一个页面。
或我可以使用会话。我的大多数网站都有会话。我们可以创建一个会话数组吗?会话[0],会话[1]?因为每个id都需要有一个会话ID。
最终结果:
展开 | 选择 | Wrap | 行号
解决方案
你可以通过序列化将数组放入会话中并稍后将其反序列化
查看php.net/serialize
url?参数不是是的,你需要一个像url这样的值?参数= 123ABC
要传递第二个参数,用这样的&符号分隔它们
url?param1 = 123& param2 =马
Dan
good早上 - 会在一段时间后发布我的结果,谢谢你的回复!
你好 -
我已经尝试过你的解释给我了。你能用会议给我一个更好的例子吗?将变量传递给下一页。
因此查询可以提取多个结果。并且每个结果都有自己的id。我希望在会话中设置该ID并传递到下一页。
我可以使用单个值但不是多个值来处理当前会话。
因此多个值将在数组中,但只有选择的值将被传递。
i我尝试时会出错那个mysql结果集错误。我将会话变量向下移动到查询下方,但仍然是同样的错误。
提前感谢您的帮助,
theo werntz ii
hello -
trying to get a link to pass the value to another page from a mysql query in php through the url.
or i could use sessions. most of my site is with sessions. Can we create an array of sessions? session[0], session[1]? because each id would need to have a session id.
final outcome:
Expand|Select|Wrap|Line Numbers
解决方案
You can put an array into a session by serializing it first and unserializing it later
check out php.net/serialize
url?parameter is not right, you need a value like url?parameter=123ABC
to have a second parameter passed, separate them by a ampersand like this
url?param1=123¶m2=Horse
Dan
good morning - will post my results in a while thanks for the response!
hello -
i''ve tried what your explaining to me. can you give me a better example with using sessions? to pass the variable to the next page.
so the query can pull multiple results. and each result will have its own id. i want that id to be set in session and passed to the next page.
i have it working fine with my current sessions on a single value but not multiple values.
so the multiple values will be in the array but only the choosen one will be passed.
i get an error when i try it says that the mysql result set error. i moved the session variable down below the query and still same error.
thanks in advance for your help,
theo werntz ii
这篇关于ahref链接动态数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取
|
15天全站免登陆