php get 使用 php 会话变量
我知道使用表单时可以使用 POST 或 GET。我将 url 存储在 php 会话变量中。我想知道如果我要单击一个将用户发送到我的另一个页面的链接,我可以使用 $_GET 来获取所单击的必要链接吗?
例如:
<?php echo "<a href='myotherpage.php'>".$_SESSION['myvar']."</a>";
myvar =“google.com”;
因此,如果我单击该链接,我会需要它,这样它就会带我到另一个页面,该页面使用 cURL 来抓取 php 会话 (myvar) 变量。
这可能吗,还是有更简单的方法让我处理事情?
对于那些想知道这就是我正在尝试做的事情的人。我正在尝试创建我访问的论坛的移动版本,其中所有者不想投入工作来制作移动友好版本。我正在使用 cURL 创建一个移动友好版本来获取线程和帖子。
上述问题的答案将帮助我获取线程中的帖子。预先感谢您的任何帮助!
I know when using forms you can use POST or GET. I am storing urls in a php session variable. I was wondering if I were to click a link that I have that sends a user to another page of mine, can I use $_GET to grab the necessary link that was clicked.
For example:
<?php echo "<a href='myotherpage.php'>".$_SESSION['myvar']."</a>";
myvar = "google.com";
So if I were to click that link I want it so it takes me to my other page which uses cURL to scrape the php session (myvar) variable.
Is this possible or is there an easier way for me to go about things?
For those wondering this is what I am trying to do. I am trying to create a mobile version of a forum I visit where the owner does not want to put in the work to make a mobile friendly version. I am creating a mobile friendly version using cURL to fetch the threads and posts.
The answer to the questions above will be assisting me fetch the posts in a thread. Thanks in advance for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
然后在 $_GET['my_var'] 中你会找到“google.com”
Then in $_GET['my_var'] you'll find "google.com"
这是您可能一直在寻找的吗?
Is this what you might been searching for?