Undefined index php help

-4

Good people I'm doing a php test and it gave me an error that I'm not able to solve this is the test:

andhereismyworktheerrorandline22

    
asked by anonymous 16.03.2018 / 14:00

1 answer

0

I believe this problem is happening because there is no Session with value 'x' defined. For your code the session is defined in a javascript function that is never called: /. In other words, if you try to use the 'x' Session and it does not exist it will probably give undefined index error. And this you can handle with an if before display, such as:

isset($_SESSION['x']) ? $_SESSION['a'] : null;

Attempts to call the function "numerox ();" or by an onclick / onchange event, or put this excerpt after the end of the function, just to see if it works, if it does not work, post the code to help you better.

    
09.04.2018 / 18:41