Jump to content

[SOLVED] input validation error


gwolff2005

Recommended Posts

hi guys,

maybe something really simple, but i dont get it.

I declare variables at the beginning of the session. Later I want to show a graph to the user (if the data is in mysql), if they are not stored in mysql a text should come up, saying: "You need to do the test." Still it does not work.

My session variable is

$_SESSION['MM_resultsmo'] = $row['resultsmo'];

and my code is:

 

if (!empty(MM_resultsmo)){
echo "You need to do the test";
} else {
echo " " . $_SESSION['MM_resultsmo'];
}

 

What is wrong???

Link to comment
https://forums.phpfreaks.com/topic/154185-solved-input-validation-error/
Share on other sites

That does not work. Even the variable is in the database it just shows "You need to do the test. As a control I displayed the variabel in another field next to it, so the variable works, but not in this code.

it would .. !empty() is like saying, "not empty".  think about it.

 

if (empty($_SESSION['MM_resultsmo'])) {
  echo "You need to do the test";
} else {
  echo " " . $_SESSION['MM_resultsmo'];
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.