Hi Everyone,

I am having a little trouble getting a memory variable and a session variable to 
compare correctly

I have an if statement as below:

if ($id=='{$SESSION["id"]}') {
    echo "working";
}

ID is a memory variable that is equal to five, and the session variable id is also 
equal to five.

When I do through the check again $id is set to be the characters {$SESSION["id"]} 
rather than the five that it was previously assigned to.

Basically what it is doing is assigning the characters proceeding the = sign to the 
variable $id rather than doing the comparison.

Does anyone know how I can get around this.  I tried two = signs and the working 
message does not display, but one = sign displays the message but does it also changes 
the value of $id.

Has anyone got any idea how I can get around this problem?

Thanks,
Michael.

Reply via email to