|
Author |
Message |
Kdawg
Senior WebHelper
Joined: 21 Apr 2003
Posts: 153
|
Posted:
Tue May 13, 2003 10:20 pm (21 years, 1 month ago) |
|
This is what im trying to do and I can figure it out, The variable $name = gruhn, I want to check if $name == $gruhn. How could i make it so it adds the $ on the front of the value of $name? |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Wed May 14, 2003 2:08 pm (21 years, 1 month ago) |
|
Sorry but I don't understand your question. It seems simple enough, but I'm just not sure what you mean . Could you rephrase? |
________________________________
|
|
|
|
Kdawg
Senior WebHelper
Joined: 21 Apr 2003
Posts: 153
|
Posted:
Wed May 14, 2003 4:26 pm (21 years, 1 month ago) |
|
Ok, Il try to explain this better, although it is hard to explain. The variable $name contains the username, ex: gruhn. The variable $pass contains the password they entered. There is a variable for each user that contains there real password, like the variable $gruhn contains gruhns password, etc. If the name in $name is gruhn I want to see if $pass == $gruhn. If the name in $name is karlyn I want to see if $pass == $karyln without using an if statment for each one. |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Wed May 14, 2003 4:39 pm (21 years, 1 month ago) |
|
Code: | if ($pass == $$name) {
$correct_password = true;
} |
[The double $ sign is intentional ] |
________________________________
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Wed May 14, 2003 4:56 pm (21 years, 1 month ago) |
|
$$name, eh? cool...though I think it would be better if the usernames/passwords were stored in arrays, would just be tidier. |
________________________________ It's turtles all the way down... |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Wed May 14, 2003 4:59 pm (21 years, 1 month ago) |
|
Yes, I have to agree with adam, storing passwords in such a way is crazy, unless you only have a few .
If $name = 'Daniel' then $$name is the same as $Daniel
Nice, isn't it |
________________________________
|
|
|
|
Kdawg
Senior WebHelper
Joined: 21 Apr 2003
Posts: 153
|
Posted:
Wed May 14, 2003 6:55 pm (21 years, 1 month ago) |
|
I only have 11 passwords plus they come out of a database so they have to be seperate. |
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.125689 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |