网址使用“/”而不是“?”而不是“?”发送变量 [英] URL use "/" instead of "?" to send variables
本文介绍了网址使用“/”而不是“?”而不是“?”发送变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在正常的php中,我们使用?id = 123通过URL发送变量。
因此,URL将是 www.example.com/page.php?id=123 然后我们使用$ _REQUEST [''id'']在另一页上接收变量。
但我的问题是,如果我使用/而不是?而不是? (例如: www.example.com/page.php/id/123 ),然后如何接收id在page.php。
$ _REQUEST [''id'']在这种情况下不起作用。
谢谢你提前
Hi,
In normal php, We use ?id=123 to send variable through URL.
So, the URL would be www.example.com/page.php?id=123 and then we use $_REQUEST[''id''] to receive the variable on another page.
But my question is, if I use "/" instead of "?" (Ex: www.example.com/page.php/id/123), then how to receive the "id" on page.php.
$_REQUEST[''id''] doesn''t works in this case.
Thank you in advance
推荐答案
_REQUEST [''id'']在另一页上接收变量。
但我的问题是,如果我使用/而不是?而不是? (例如: www.example.com/page.php/id/123 ),然后如何接收id在page.php。
_REQUEST[''id''] to receive the variable on another page.
But my question is, if I use "/" instead of "?" (Ex: www.example.com/page.php/id/123), then how to receive the "id" on page.php.
_REQUEST [''id'']在这种情况下不起作用。
提前谢谢
_REQUEST[''id''] doesn''t works in this case.
Thank you in advance
这篇关于网址使用“/”而不是“?”而不是“?”发送变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文