English 中文(简体)
PHP Session Variable from URL
原标题:PHP Session Variable from URL

I m不熟悉PHP会议变量,也不熟悉这些变量的准确工作,但Im则在一个有机动对应人员的网站工作。 在流动地点(由另一家公司开发)上,连接到使用URL的整座网站?mobile=false,而Im只是想知道我如何利用这一途径使移动用户能够进入整个网站?

最佳回答

您的切入点就是:

if (isset($_GET[ mobile ]) && $_GET[ mobile ] ==  false )
{
    session_start(); // If you haven t done so already
    $_SESSION[ ShowFullSite ] = true;
}

然后可以核对<代码>_美元 会后[显示未来]

问题回答

You can access this URI part with $_GET[ mobile ] where this will hold false then. And btw. this is not a session variable.

i 认为你会利用库克群岛,如母体发展,而不是届会:

you can get the parameter using $_GET[ mobile ] in the first page and set the session variable in that page and you use it in other pages. To set the session you need to start the session first. session_start(); Then to set $_SESSION[ mobile ]=false; You can check in pages by if($_SESSION[ mobile ]){ } To clear session you can use session_unset();

如果我理解,你有两个不同的地点,如果你想要把用户转头,那么你就必须在你的移动站点的指数中增加这样的内容:

  if (isset($_GET[ mobile ]) && $_GET[ mobile ] ==  false ))
       header( Location: http://www.myfullsite.com/ );




相关问题
why the session in iis automatically log out?

I used iis6, and when i called a function Directory.delete(), the all the session relate this website will be logged out. and i debugged the website, i found no exception. any one have ideas on this ? ...

Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

Can I get the size of a Session object in bytes in c#?

Is it possible to get the size(in bytes) of a Session object after storing something such as a datatable inside it? I want to get the size of a particular Session object, such as Session["table1"], ...

提供严格分类的出席会议物体

提供严格分类的与会机会的最佳方式是什么? 我正计划转而选择矩阵,这正在促使汇编者抱怨我的幻觉方案拟订方法......

PHP Session is not destroying after user logout

I m trying to create an authentication mechanism for my PHP Application and I m having difficulty destroying the session. I ve tried unsetting the authentication token which was previously set within ...

热门标签