English 中文(简体)
php 美元
原标题:php $_SESSION array not retaining values stored from previous pages

I am trying to create a form where there are multiple sections. It is actually an online menu ordering system. If you remain on the same section (say.. Appetizer), the values successfully load into $_SESSION and displays in the textbox as value. However, if you switch sections (say.. Soups), the values first loads. But when you submit your order for that particular section/switch sections, it loses the values from Appetizer.

似乎像我的会议阵列一样,它只能从POST阵列中收回价值,不能保留原来储存的价值。

谁能告诉我我我我什么是错的? 我就此说得相对新。

这部法律是......

问题回答

让我保证,会议实际上是在你的服务器上工作。 在它自己的档案中进行这种编号。 仅举几例。 反之应每次增加。 是否? 是否有任何错误?

<?php
error_reporting(E_ALL | E_STRICT);
ini_set( display_erorrs , true);
session_start();

if(!array_key_exists( counter , $_SESSION))
    $_SESSION[ counter ] = 0;

echo "You have visited this page " . $_SESSION[ counter ] . "times.";
exit;
session_start();

页: 1

感谢大家的答复。 因此,该服务器离开空间。 我在一个不同的服务器上测试了该守则,并且只打了罚款!

i 想把所有价值观都写进午餐会。 因此,第二次储存以前的价值被废除。 只试图储存物品名称和数量的价值。





相关问题
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 ...

热门标签