Hi and thansk again for all your help and replies.
I now have this:
<?php
if ($_SESSION['_amember_user']['secure_id_1'] > 1) {
// First session variable > 1, so display second session variable.
echo $_SESSION['_amember_user']['secure_id_1'] . "<br />\n";
echo $_SESSION['_amember_user']['secure_id_2'] . "<br />\n";
if (($_SESSION['_amember_user']['secure_id_1'] > 1) && ($_SESSION['_amember_user']['secure_id_2'] > 1)) {
// First and second session variables > 1, so display third variable.
echo $_SESSION['_amember_user']['secure_id_1'] . "<br />\n";
echo $_SESSION['_amember_user']['secure_id_2'] . "<br />\n";
echo $_SESSION['_amember_user']['secure_id_3'] . "<br />\n";
}
}
?>
What I need to do is to understand how the else and else if stantements work so I can display "if first condition is truem display this" and "if second condition is true display that".
So I have tried to unsert an elseif by doing this:
<?php
if ($_SESSION['_amember_user']['secure_id_1'] > 1) {
// First session variable > 1, so display second session variable.
echo $_SESSION['_amember_user']['secure_id_1'] . "<br />\n";
echo $_SESSION['_amember_user']['secure_id_2'] . "<br />\n";
}
else
{
if (($_SESSION['_amember_user']['secure_id_1'] > 1) && ($_SESSION['_amember_user']['secure_id_2'] > 1)) {
// First and second session variables > 1, so display third variable.
echo $_SESSION['_amember_user']['secure_id_1'] . "<br />\n";
echo $_SESSION['_amember_user']['secure_id_2'] . "<br />\n";
echo $_SESSION['_amember_user']['secure_id_3'] . "<br />\n";
}
}
?>
The script works up to a point.
It does not show the content of "echo $SESSION['amember_user']['secure_id_3'] . "<br />\n"; " which I know has content.
The content of "secure_id_1" is 111111
The content of "secure_id_1" is 222222
The content of "secure_id_1" is 333333
Or should I be testing for any content i.e "Isset" I think and if the 1st variable has any content, display it and then test for content of the second variable, and if there is content display it and test for content in the third variable, and so on.
I am not to sure which is the correct way to do this.
Many thanks again.