从网址传递价值问题? [英] Passing value from url problem?

查看:67
本文介绍了从网址传递价值问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我正在使用页面网址在页面之间传递值。我用urls设置了页面 -

1)。 threads.php?catagory = catagory1,

2).posts.php?catagory = catagory1(使用$ _GET从上面的url获取值),&id = 6(来自catagory1表的主键id), &name = topicname(来自回复表的主题名),以及

3)。 reply.php(上面的url使用get),我还有更多的页面,但我认为只有在我卡住的地方才能包含这些页面。现在我想从thread.php页面上面的任何一个链接(1或2)传递名称值,这样我就可以编写类似的查询 -

select * from tablename where topicname ='$ _ GET [ name]'我可以在threads.php上显示回复的数量对应于那里的topicname。有什么办法吗?

解决方案

_GET),&id = 6(来自catagory1表的主键id),&name = topicname(来自回复的主题名称)表),和

3)。 reply.php(上面的url使用get),我还有更多的页面,但我认为只有在我卡住的地方才能包含这些页面。现在我想从thread.php页面上面的任何一个链接(1或2)传递名称值,这样我就可以编写类似的查询 -

select * from tablename where topicname ='

_GET [name]'我可以在threads.php上显示回复的数量对应于那里的topicname。有没有办法做到这一点?


我不能让你完美但这和你想要的一样



< a href =http://html.net/tutorials/php/lesson10.php> http://html.net/tutorials/php/lesson10.php [ ^ ]



问候...... :)



[更新]





http://html.net/tutorials/php/lesson10.php [ ^ ]



http://php.about.com/od/troubleshooting/f/php5_variables.htm [ ^ ]

http://stackoverflow.com/questions/5719589/passing-a-php-variable-in-the-url [ ^ ]



http://www.dynamicdrive.com /forums/showthread.php?34485-How-do-you-pass-a-value-through-the-address-URL [ ^ ]



http://php.net/manual/en/reserved。 variables.get.php [ ^

Ok, i am using page url to pass values among pages. I have set pages with urls-
1). threads.php?catagory=catagory1,
2).posts.php?catagory=catagory1(got value from above url using $_GET), &id=6(its primary key id from catagory1 table),&name=topicname(its topicname from a replies table), and
3). reply.php(with above url using get), and i have also many more pages but i think its good to include those pages only where i stuck. Now i want to pass name value from any of the links above (1 or 2) on thread.php page so that i can write query like-
select *from tablename where topicname='$_GET[name]' sothat i can display number of replies on threads.php correspond to there topicname. Is there any way to do it?

解决方案

_GET), &id=6(its primary key id from catagory1 table),&name=topicname(its topicname from a replies table), and
3). reply.php(with above url using get), and i have also many more pages but i think its good to include those pages only where i stuck. Now i want to pass name value from any of the links above (1 or 2) on thread.php page so that i can write query like-
select *from tablename where topicname='


_GET[name]' sothat i can display number of replies on threads.php correspond to there topicname. Is there any way to do it?


i can't get you perfectly but this is same what you want

http://html.net/tutorials/php/lesson10.php[^]

regards...:)

[updated]


http://html.net/tutorials/php/lesson10.php[^]

http://php.about.com/od/troubleshooting/f/php5_variables.htm[^]
http://stackoverflow.com/questions/5719589/passing-a-php-variable-in-the-url[^]

http://www.dynamicdrive.com/forums/showthread.php?34485-How-do-you-pass-a-value-through-the-address-URL[^]

http://php.net/manual/en/reserved.variables.get.php[^]


这篇关于从网址传递价值问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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