D
D
des1roer2014-12-11 11:08:36
PHP
des1roer, 2014-12-11 11:08:36

session php. Copied page. Variables stopped working. What could it be?

In general, I made a page where, when you click on the submit, if the value of the session variable changed from zero to one. copied the page, renamed. but to work

if(isset($_POST['ses']))
    {
        if ($_SESSION['act2'] == 1) $_SESSION['act2'] = 0;
        else $_SESSION['act2'] = 1;

stopped. what is it maybe7 you can not give the same names to session variables or how is it even possible?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
des1roer, 2014-12-11
@des1roer

the issue can be considered closed, the case was somewhat different. but still how will PHP react to the same names of session variables on different pages?

A
andymitrich, 2014-12-11
@andymitrich

Well, you would still bring the code, otherwise guessing is not very convenient - maybe you forgot to start the session there or something else ...

I
Ivan Belyakov, 2014-12-11
@aspej

session_start(); at the very beginning of the page did not forget to specify?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question