Exclusions problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
3.14
Forum Commoner
Posts: 28
Joined: Mon Sep 08, 2003 12:17 am

Exclusions problem

Post by 3.14 »

if( $code_so_far = "ANNNNLKX" )
{
echo "Your Code is Valid";
}

Ok, here's the problem. No matter what code gets put in, it always displays "Your Code is Valid". How do I set it so that it only displays "Your Code is Valid" if the above code is entered?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Code: Select all

if( $code_so_far = "ANNNNLKX" )
...means that you set $code_so_far to that value each time you run it, ie. it will allways match.

Note the difference between using = and == ? ;)
Post Reply