[PHP] Is this code thread safe?

2007-06-13 Thread Christian Cantrell

I'm pretty sure this code is thread safe, but I just want to be 100% sure.
I have a class called ViewHelper with a static function called is_signed_in.
All it does is check the session for the existence of a particular
variable, and if it's there, it returns true, otherwise false.

Since the function is static, is there any way this code is not thread safe?
Is there any way I could be checking someone else's session if the requests
are concurrent?

Thanks,
Christian


Re: [PHP] Undefined index error

2007-06-10 Thread Christian Cantrell

Ah, you're right.  Thanks, Tijnema.

I'm just getting my feet wet with PHP, and you guys are a great help!

Christian

On 6/10/07, Tijnema [EMAIL PROTECTED] wrote:


On 6/10/07, Christian Cantrell [EMAIL PROTECTED] wrote:
 I'm getting this error in my Apache log file, and I can't figure out
why:

 Undefined index:  password in /path/to/file.php on line 82

 Some searching on Google turned up a bunch of questions, but no answers.
 Any idea what this warning message is referring to?

 Thanks,
 Christian

Yes, you're probably trying to get a value from an array by using a
key that isn't in the array.
Something like this:
?php
$array = array( user= test, foo=bar);
$value = $array['password']; // Key password doesn't exist!
?

Check the line number and print out the array with var_dump/print_r to
see what's in the array..

Tijnema




[PHP] Undefined index error

2007-06-09 Thread Christian Cantrell

I'm getting this error in my Apache log file, and I can't figure out why:

Undefined index:  password in /path/to/file.php on line 82

Some searching on Google turned up a bunch of questions, but no answers.
Any idea what this warning message is referring to?

Thanks,
Christian


[PHP] Sending mail on OS X

2007-06-08 Thread Christian Cantrell

Hi, all.  I'm sure this question has been asked, but I was not able to
effectively search the forum archives, so I'm having to ask it again.

I'm trying to use the mail function to send email on OS X, but the email
gets rejected by the mail server I'm sending to.  I get messages in
mail.loglike this:

The IP you're using to send email is not authorized to send email directly
to our servers.

I tried sending mail through another server using the SMTP and smtp_port
settings in my php.ini files, but the settings seem to be ignored (perhaps
they are Windows only?).  Can anyone tell me how I can successfully send
test emails on OS X?

Also, the From header does seem to be getting successfully set.  Is there
anything wrong with this code?

mail('[EMAIL PROTECTED]', 'php test', 'this is the message.\nthis is another
line.', 'From: [EMAIL PROTECTED]'.\n\r);

Thanks,
Christian