php-general Digest 23 Jan 2011 14:08:15 -0000 Issue 7148

Topics (messages 310976 through 310980):

Re: No SMTP server? Can't get mail()
        310976 by: David Robley

Different sessions, same client
        310977 by: Paul M Foster
        310978 by: Thijs Lensselink
        310979 by: Ashley Sheridan

Zend Memory Manager
        310980 by: Adi Mutu

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Paul S wrote:

> On Fri, 21 Jan 2011 13:41:21 +0700, Peter Lind <peter.e.l...@gmail.com>
> wrote:
> 
>> Probably not the solution you were looking for, but I've always found
>> mail()
>> very unstable and I tend to use a mail library instead. Like phpmailer or
>> swiftmailer. Easier to configure and figure out problems with.
>>
>> Regards
>> Peter
> 
> Peter, that is warranted advice here.
> 
> I'm a little new to PHP. I'm set up to develop Apache/PHP/MySQL on my PC
> uploading results to a unix server. My situation here is that I am trying
> to get a PHP Mailing List program running for a friend's business web site
> (on unix). That program has 2 options for mailing: 1) mail()/SMTP and
> 2) phpmailer options. Mail()/SMTP works, at least, on my PC. But I can't
> get either of
> the two emailing options to work on the UNIX server. (Whatever those mail
> problems are, it is mangled with odd PHP/MySQL problems on unix).
> I'm just 'back here' starting debugging with the mail()/SMTP option on
> unix and my conclusion based on feedback above (thank you) is that email
> IS reaching the unix SMTP server but is not being forwarded (and that's
> unresolved now).
> 
> My mentioned "SMTP server echo problem" is irrelevant. Maybe they fixed it
> last night, or maybe I was smoking something yesterday. It IS echoing
> correctly.
> I finally figured out that part of my problem was misunderstanding a
> warning
> message caused by my not single quoting SMTP (yikes!).
> 
> Or maybe I was just
> enraged over my lack of success all day yesterday to confirm Apache server
> information on the unix server (which would help me guarantee that I have
> the same Apache/PHP/MySQL configurations between the PC and unix servers).
> But today the SMTP server info IS echo'd on the unix server. From the Unix
> server ...
> 

Nobody seems to have mentioned it, but the SMTP info is only needed on a Win
system. The following is an extract from a default php.ini file:

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = m...@example.com

; For Unix only.  You may supply arguments as well
(default: "sendmail -t -i").
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra
parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

mail() should be functional; if mail() is returning true then your next step
in the debug process would be to check the mail logs, if they are
accessible to you.

On the other hand, using an SMTP class will give you a bit more
functionality.




Cheers
-- 
David Robley

Supernovae are a Blast
Today is Pungenday, the 23rd day of Chaos in the YOLD 3177. 


--- End Message ---
--- Begin Message ---
Storing any sort of login/auth data in cookies has regularly been panned
on this list. The preference seems to be to store whatever login/auth
information *must* be stored in the $_SESSION variable.

Well and good. My problem, however, is that I have multiple applications
in different tabs running on the same server, which may all use the same
sub-variables, like "username". As a result, they run into each other.
One application will think I'm logged in when I'm not logged in to that
application, but to another in the same browser on the same box.

So my question is how to prevent this using the standard PHP functions
relating to sessions. I'd like different applications in different tabs
on the same box/browser to have different sessions, so they don't share
data.

Thoughts?

Paul

-- 
Paul M. Foster
http://noferblatz.com


--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/23/2011 07:33 AM, Paul M Foster wrote:
> Storing any sort of login/auth data in cookies has regularly been panned
> on this list. The preference seems to be to store whatever login/auth
> information *must* be stored in the $_SESSION variable.
> 
> Well and good. My problem, however, is that I have multiple applications
> in different tabs running on the same server, which may all use the same
> sub-variables, like "username". As a result, they run into each other.
> One application will think I'm logged in when I'm not logged in to that
> application, but to another in the same browser on the same box.
> 
> So my question is how to prevent this using the standard PHP functions
> relating to sessions. I'd like different applications in different tabs
> on the same box/browser to have different sessions, so they don't share
> data.
> 
> Thoughts?
> 
> Paul
> 


Using session_name will allow you to run two different sessions in the
same browser.

session_name('app1');
session_start();
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBAgAGBQJNO+TpAAoJEMffsHAOnubXzHYQAI86mjCR49uWTPYweFim9e+K
EtU4KnFfXkQj+Qp0YYjjuiAW0muRywbjKkwuAmw7fO/v9DrbGILAvnneNX7OR9cM
TBh66J6anuLB3UmItrmFqP2VKgWaLG7KHf0wExfv3duzJkRqp5Y8NQG1Ep8aXA0U
8N2VHQ1ki9ukHeIWcPI4l5558j0NE/5BsiWgJIgTC/CovDjdNYln9vszkmFw0g2G
vJore2V3OIBcmLhqpcITSNK4FcaNWIKnrRWnlCgoAzA1WUCQXnmv0nJMZ0P9xtzk
iYt2lkBvlGEJ8lnZoAo83XRsQ1oI6vLFwf5xDkI4OGnAsOIzmX3RzStxXyz9o5th
VyIHtj8R40Rk6eI6L5xE4w1l58JTFMPdgaFk5Ku/v8i8UGDWjWHC0Qhob14w+H32
RQUtx9dBsYKYT9ZHIkxAQYDc9nTdgajRzo0ONqmzPTS9Qb7NTcjiC9pb1bHBjubA
M4zJnyO5N7IUy0FmMyS7PG8saCgJDSYj+stvoCC9Kd0eDRBKs+M5cRLpnXem/Yf8
KG+clIe5+7X9l1TC7uT84HxZYSZCcuwuvRyBUIZknagyREQvLhaFX1OPZ/vk3n6S
j7k77oFpcCRjkPVKZeUqFAENEY1J7p6DBEkTz9gRkA+islnSIt8rjz+0wYYg0goy
b3C3ThlftPWwcOBuRQOP
=ZBm8
-----END PGP SIGNATURE-----

--- End Message ---
--- Begin Message ---
On Sun, 2011-01-23 at 09:21 +0100, Thijs Lensselink wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 01/23/2011 07:33 AM, Paul M Foster wrote:
> > Storing any sort of login/auth data in cookies has regularly been panned
> > on this list. The preference seems to be to store whatever login/auth
> > information *must* be stored in the $_SESSION variable.
> > 
> > Well and good. My problem, however, is that I have multiple applications
> > in different tabs running on the same server, which may all use the same
> > sub-variables, like "username". As a result, they run into each other.
> > One application will think I'm logged in when I'm not logged in to that
> > application, but to another in the same browser on the same box.
> > 
> > So my question is how to prevent this using the standard PHP functions
> > relating to sessions. I'd like different applications in different tabs
> > on the same box/browser to have different sessions, so they don't share
> > data.
> > 
> > Thoughts?
> > 
> > Paul
> > 
> 
> 
> Using session_name will allow you to run two different sessions in the
> same browser.
> 
> session_name('app1');
> session_start();
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> 
> iQIcBAEBAgAGBQJNO+TpAAoJEMffsHAOnubXzHYQAI86mjCR49uWTPYweFim9e+K
> EtU4KnFfXkQj+Qp0YYjjuiAW0muRywbjKkwuAmw7fO/v9DrbGILAvnneNX7OR9cM
> TBh66J6anuLB3UmItrmFqP2VKgWaLG7KHf0wExfv3duzJkRqp5Y8NQG1Ep8aXA0U
> 8N2VHQ1ki9ukHeIWcPI4l5558j0NE/5BsiWgJIgTC/CovDjdNYln9vszkmFw0g2G
> vJore2V3OIBcmLhqpcITSNK4FcaNWIKnrRWnlCgoAzA1WUCQXnmv0nJMZ0P9xtzk
> iYt2lkBvlGEJ8lnZoAo83XRsQ1oI6vLFwf5xDkI4OGnAsOIzmX3RzStxXyz9o5th
> VyIHtj8R40Rk6eI6L5xE4w1l58JTFMPdgaFk5Ku/v8i8UGDWjWHC0Qhob14w+H32
> RQUtx9dBsYKYT9ZHIkxAQYDc9nTdgajRzo0ONqmzPTS9Qb7NTcjiC9pb1bHBjubA
> M4zJnyO5N7IUy0FmMyS7PG8saCgJDSYj+stvoCC9Kd0eDRBKs+M5cRLpnXem/Yf8
> KG+clIe5+7X9l1TC7uT84HxZYSZCcuwuvRyBUIZknagyREQvLhaFX1OPZ/vk3n6S
> j7k77oFpcCRjkPVKZeUqFAENEY1J7p6DBEkTz9gRkA+islnSIt8rjz+0wYYg0goy
> b3C3ThlftPWwcOBuRQOP
> =ZBm8
> -----END PGP SIGNATURE-----
> 


You can of course use arrays in your session as well:

$_SESSION['app_name'] = Array(
    'username' => 'John',
    'user_id' => 1234,
    'some other info' => 'another string',
);

I use this on my localhost sometimes, as it can be easier running tests
and stuff than having to create a whole new host entry for it in my
config files!

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---

Hello,

This is my first mail here, i hope it's ok.
Can somebody give me any hint to some docs about how the Zend mm works? I can't 
find any references on the net.....
I'm not interested in only emalloc, efree etc. but at an even lower level  i 
mean about functions like _zend_mm_alloc_int, _zend_mm_alloc_int
and structs like zend_mm_heap.

Thanks,
A.


      

--- End Message ---

Reply via email to