$ _sessions [英] $_sessions

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

问题描述

如何将多页形式的多个变量保存到$ _SESSION

以便以后检索它们??

how do you save multiple variables in a multiple page form to $_SESSION
in order to retrieve them later...?

推荐答案

_SESSION

以便以后检索它们??

_SESSION
in order to retrieve them later...?


Quinonez,


我假设您在询问如何设置和使用会话。要使用

会话,您必须将以下内容放在每页的最顶层。


<?php session_start(); ?>


完成后,您可以在页面上使用会话。现在设置一个

的会话,你可以做以下事情

Quinonez,

I assume you are asking how to set and use sessions. In order to use
sessions you must put the following at the very top of every page.

<?php session_start(); ?>

Once you have done that you can use sessions on the page. Now to set a
session you do the following


_SESSION [''name''] =" John" ;;


这将设置名为name的会话。具有John的值。然后

你可以像这样回复它。


echo
_SESSION[''name'']="John";

This will set the session named, "name" with the value of "John." Then
you could echo it back out like so.

echo


这篇关于$ _sessions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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