No....keep writing to the list. Next time, you might actually give the example like you did here so that, hopefully someone will be able to answer you better (I have a problem of not including enough myself). The first question, in itself, sounded like a basic question. I would be surprised if you didn't get a lot of heckling about it. I tried to keep my answer from sounding bad to you the first time because I have been there and still am there. Most of us have, but some won't admit it. Sometimes I forget it too. :)
I am not an expert at PHP / MySQL. To me it would sound like the one = is assigning the $VerifyPasword[ContactID] whatever is in $_SESSION['ContactID'] which would mean that the else part would never be executed. Honestly though, there is a lot that I don't know. I know very little compared to how much I don't know. So I will also post this to the list and hopefully someone will know the answer to this.
At 08:09 PM 5/9/2002, "Chris Knipe" <savage@savage.za.org> wrote:
I don't want to keep flooding the mailing lists now with my crap, and I do
hope you don't mind me emailing you privately, but these if statements are
annoying to say the lease.
From what I read on php.net (as well as on various other documents for other
languages like C, and Perl), I am using if statements correctly - syntax
wise at least.
What baffles me, is
while ($VerifyPassword = mysql_fetch_array($PasswordCheckSQL)) {
// Compare UserIDs
if ($VerifyPasword[ContactID] = $_SESSION['ContactID']) {
$_SESSION['Authenticated'] = "True";
$AuthenticationFailure = "False";
} else {
$_SESSION['Authenticated'] = "False";
$AuthenticationFailure = "True";
}
Works ($VerifiyPassword[ContactID] comes out of a MySQL Lookup,
$_SESSION['ContactID'] was previously, also looked up via a MySQL Query).
However, from what I understand in the documentation, in this case, the if
statement should be '==' in which case, it doesn't work ?!?!?!?!?!?!? This
is exactly what I am talking about, and why it is so confusing. Everywhere,
I use either a double =, or triple = in the if statements, with a ! to use
the is "not" true... Only in this specific statement, the only way I can
get it to work, was with a single =. Now what makes that if statement so
special over the others, that this one requires a single = and not a double
like all the other hundreds I have in my code?
:) Thanks.
--
me
----- Original Message -----
From: "Steve Buehler" <steve@vespro.com>
To: "Chris Knipe" <savage@savage.za.org>; <php-general@lists.php.net>
Sent: Thursday, May 09, 2002 11:04 PM
Subject: Re: [PHP] Destroying Sessions
Best bet is to go to any book store that carries programming books and
pick
up a book on PHP. There are so many different things that you need to
know
that nobody can mention them all here. The other option is to go to
http://www.php.net and read everything the site has.
$var = $value
assigns $value to the variable $var.
$var == $value
tests to see if $var and $value are equal.
Steve
At 07:00 PM 5/8/2002, Chris Knipe wrote:
Nevermind....
For it sorted... Does anyone have any reference to any documentation on
how to use if statements properly?
I know this sounds silly now, but when exactly do you use $var = $value,
or
$var == $value, and all the other operators?
I'd really like to read up on this if someone can point me to a good
reference... I'm having the same type of situations with Perl as well...
Maybe it's just be who is stupid here... But hey, I'm trying :)
--
me
----- Original Message -----
From: "Chris Knipe" <savage@savage.za.org>
To: <php-general@lists.php.net>
Sent: Thursday, May 09, 2002 1:43 AM
Subject: [PHP] Destroying Sessions
Hi all,
Need some more help here unfortunately. This time, I did check the
manual,
and well, I'm not to sure what I'm doing wrong...
From a global (shared) script, I start a session....
<? session_start(); ?>
I register session data, and use them throughout the site
<? $_SESSION['something'] = "whatever"; ?>
Now, how on earth do I destroy that session?
<?
include('../include/functions.inc');
session_unset();
$_SESSION = array();
session_destroy();
header ("Location: /index.php");
?>
I've tried all of that, to no prevail, the session remains, and my
values
registered in $_SESSION['whatever'] still remains??????
Any help / pointers, much needed and appreciated.
--
me
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php