Logic problem with login page
Posted: Sat Oct 25, 2008 6:10 am
Ok this one is complicated... Not because I am a pro, but because I really messed the code up... I started making a personal diary project
just for the practice. I only made the login page when I decided to transfer my code to a good looking template. The problem with template is
that the login box is on the left side of main page...Here is what I want to do: I want the login box to dissapear whenever I login. I have
tried this approach, which btw doesn't work:
The reason the code DOESN'T work is because the variable $a gets refreshed once I press the submit button of my login page, and when it does
gets refreshed $a loses its "true" value give to int earlier and it goes to the "else" part of loop... so no avail.
I have tried putting a switch statement too:
It does the same job. Now you might say that I may try putting a particular value for the variable to make the box appear like this :
But the problem with such statement is that the value in $a is NOT false... Suppose even If keep $a="true" in start of code but that will
cause the whole loop to NOT work everytime...
It is a logical problem... Can't figure out any way
... If you guys need code I will be more than willing. I just didn't place it because It is quite confusing... Ask anything to get a clear picture.
just for the practice. I only made the login page when I decided to transfer my code to a good looking template. The problem with template is
that the login box is on the left side of main page...Here is what I want to do: I want the login box to dissapear whenever I login. I have
tried this approach, which btw doesn't work:
Code: Select all
if ($a=="true")
{
// login box disappear
}
else
{
// login box appear
}
gets refreshed $a loses its "true" value give to int earlier and it goes to the "else" part of loop... so no avail.
I have tried putting a switch statement too:
Code: Select all
Switch ($a)
{
case "true":
//login box disappear
break;
default:
//login box appear
}
Code: Select all
if ($a=="true")
{
// login box disappear
}
elseif ($a=="false")
{
// login box appear
}
cause the whole loop to NOT work everytime...
It is a logical problem... Can't figure out any way