How is possible to maintain a PHP variable defined on a PHP3 file
 (IMP 2.2.5, mailbox.php3) so that is available for another PHP3
 file (compose.php3) and for future reloads of mailbox.php3?

 I have a variable called can_use_attachs (can_use_attachs) that
 is checked on an LDAP server on mailbox.php3 and used on compose.php3.
 The idea is just to check the LDAP server just once (the first
 time) and set that variable so that future reloads do not check the
 ldap server another time.

 I'm using the following code, but I suspect that produces a segmen-
 tation fault one time each about 4000 reloads (yes, I can reload
 the page thousands of times automatically, and when I reach about
 4000 it produces a segmentation fault on token_cache.c):

// the beginning of my mailbox.php3 file
if( !isset( $can_use_attachs ) )

 if ($ds)
   $busca="uid=" . $imp->user;
   if( ldap_count_entries($ds,$sr) < 1 )
     SetCookie( "can_use_attachs", 'n', time()+3600 );
     $info = ldap_get_entries($ds, $sr);
     if( $info[0]["roomnumber"][0] == "s" )
       SetCookie( "can_use_attachs", 's', time()+3600 );
       SetCookie( "can_use_attachs", 'n', time()+3600 );

 And in compose.php3:

<? if( $can_use_attachs == 's' ) { ?>

 <input type="hidden" name="attachmentAction" value="">
 <?php endif; ?>

<?php } ?>

 Does anyone know a better way of doing the above? I don't know how
 to use PHP sessions (as used on Horde/IMP) so that I don't need
 cookies to set up that variable.
PS: and if someone can see in the above code what could be the 
cause of the segmentation fault, please tell me.

 CU and thanks a lot.
Santiago Romero
Departamento de Sistemas

Av. Primado Reig 189, entlo
46020 Valencia - Spain
Telf. (+34) 96 332 12 00
Fax. (+34) 96 332 12 01

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to