[PHP] Environment variables...
Hi, I'd like to read an environment variable with PHP. I've tried with : exec ('echo $CONTEXTE_D_EXECUTION',$result); $result is empty !!! I've put the variable in /etc/environment, in /etc/profile, in /etc/bash.bashrc but nothing worked... Do you have any idea ? If it is not possible, I suppose I can put a variable in php.ini ? Thank you very much. David. signature.asc Description: PGP signature
Re: [PHP] Environment variables...
Le Wed, 14 Mar 2007 15:40:28 +0100, "Tijnema !" <[EMAIL PROTECTED]> a écrit : > On 3/14/07, David BERCOT <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I'd like to read an environment variable with PHP. > > I've tried with : > >exec ('echo $CONTEXTE_D_EXECUTION',$result); > > $result is empty !!! > > > > I've put the variable in /etc/environment, in /etc/profile, > > in /etc/bash.bashrc but nothing worked... > > > > Do you have any idea ? > > > > If it is not possible, I suppose I can put a variable in php.ini ? > > > > Thank you very much. > > > > David. > PHP is running from apache, which is running probably from the nobody > user. This user hasn't loaded any variables i think. I think, on Debian, it is www-data. Some variables are loaded, but I don't know where they come from... If I find, I can add one ;-à > So, why are you not just reading /etc/profile from php? Yes, it is possible, but I'd like to do the same under many servers, with different OS (RedHat, Debian for example), so, files are not at the same place. David. signature.asc Description: PGP signature
Re: [PHP] Environment variables...
Le Wed, 14 Mar 2007 09:42:13 -0500, Erik Jones <[EMAIL PROTECTED]> a écrit : > Depending on your system and environment (platform and cli v. cgi), > they should be in either of the $_ENV or $_SESSION superglobals. It is Debian... But the variable I added is not in $_ENV or $_SESSION superglobals... David. > On Mar 14, 2007, at 9:32 AM, David BERCOT wrote: > > > Hi, > > > > I'd like to read an environment variable with PHP. > > I've tried with : > > exec ('echo $CONTEXTE_D_EXECUTION',$result); > > $result is empty !!! > > > > I've put the variable in /etc/environment, in /etc/profile, > > in /etc/bash.bashrc but nothing worked... > > > > Do you have any idea ? > > > > If it is not possible, I suppose I can put a variable in php.ini ? > > > > Thank you very much. > > > > David. > > erik jones <[EMAIL PROTECTED]> > sofware developer > 615-296-0838 > emma(r) > > > signature.asc Description: PGP signature
Re: [PHP] Environment variables...
Hi, Le Wed, 14 Mar 2007 17:37:02 -0500 (CDT), "Richard Lynch" <[EMAIL PROTECTED]> a écrit : > PHP runs as its own user in its own environment. > > Stuff you cram into your environment has no effect on that, as it > should be. > > If you alter the environment of the PHP user you might get what you > want. > > You may also be able to use http://php.net/setenv > > And http://php.net/getenv is probably faster than your exec. > > Setting the env up in httpd.conf and/or php.ini and/or .htaccess > should work. httpd.conf for sure, others I think. Yes, great... Now, I have another problem ;-) In Debian, everything is ok. I put my variable in /etc/apache2/httpd.conf. But on RedHat, I don't know which file is concerned... So, I've searched in php.ini, but I did not find a place where I can put variables... Do you know which is the equivalent of /etc/apache2/httpd.conf on RedHat ? And is it possible (and how ;-)) to put variables in the php.ini ? Thank you very much. David. > On Wed, March 14, 2007 9:32 am, David BERCOT wrote: > > Hi, > > > > I'd like to read an environment variable with PHP. > > I've tried with : > > exec ('echo $CONTEXTE_D_EXECUTION',$result); > > $result is empty !!! > > > > I've put the variable in /etc/environment, in /etc/profile, > > in /etc/bash.bashrc but nothing worked... > > > > Do you have any idea ? > > > > If it is not possible, I suppose I can put a variable in php.ini ? > > > > Thank you very much. > > > > David. > > > > signature.asc Description: PGP signature
Re: [PHP] Environment variables...
Everything is OK !!! Thank you very much. David. Le Thu, 15 Mar 2007 13:39:33 -, "Edward Kay" <[EMAIL PROTECTED]> a écrit : > > Yes, great... Now, I have another problem ;-) > > In Debian, everything is ok. I put my variable > > in /etc/apache2/httpd.conf. > > > > But on RedHat, I don't know which file is concerned... > > > > It's /etc/httpd/conf/httpd.conf on Fedora so I'd expect Red Hat to be > the same. > > You'd probably be best putting in /etc/httpd/conf.d/php.conf though > so as to keep all the PHP stuff in one place. (All the files > in /etc/httpd/conf.d/ are imported by httpd.conf). > > Edward signature.asc Description: PGP signature
[PHP] DateTime... What else ?
Hi, I've got a problem with DateTime. I have a short code which gives an error : $date = new DateTime(date("d/m/Y")); $date->modify("-1 month"); $mois_en_cours1 = $date->format("Y-m"); $date->modify("-1 month"); $mois_en_cours2 = $date->format("Y-m"); $date->modify("-1 month"); $mois_en_cours3 = $date->format("Y-m"); Fatal error: Class 'DateTime' not found in /var/www2/dacg_visio/index.html on line 244 If I look at the documentation : http://fr3.php.net/manual/fr/function.date-modify.php it seems to work if PHP version is above 5.1.0 (I am in 5.1.6 !). Do you have any idea about this error (Debian/Apache2) ? Do you have another way to obtain $mois_en_cours1, 2, 3 without DateTime ? Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DateTime... What else ?
Hi again, Le Thu, 17 Apr 2008 21:10:44 +1200, Simon Welsh <[EMAIL PROTECTED]> a écrit : > On 17/04/2008, at 9:05, David BERCOT wrote: > > Hi, > > > > I've got a problem with DateTime. I have a short code which gives an > > error : > > > > > > $date = new DateTime(date("d/m/Y")); > > $date->modify("-1 month"); > > $mois_en_cours1 = $date->format("Y-m"); > > $date->modify("-1 month"); > > $mois_en_cours2 = $date->format("Y-m"); > > $date->modify("-1 month"); > > $mois_en_cours3 = $date->format("Y-m"); > > > > > > > > Fatal error: Class 'DateTime' not found in > > /var/www2/dacg_visio/index.html on line 244 > > > > > > If I look at the documentation : > > http://fr3.php.net/manual/fr/function.date-modify.php > > it seems to work if PHP version is above 5.1.0 (I am in 5.1.6 !). > > > > Do you have any idea about this error (Debian/Apache2) ? > > Do you have another way to obtain $mois_en_cours1, 2, 3 without > > DateTime ? > > > > Thank you very much. > > > > David. > > > $mois_en_cours1 = date('Y-m', strtotime('-1 month')); > $mois_en_cours2 = date('Y-m', strtotime('-2 month')); > $mois_en_cours3 = date('Y-m', strtotime('-3 month')); > ?> Great ;-) Thank you very much ! David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DateTime... What else ?
Le Thu, 17 Apr 2008 10:19:10 +0100, Stut <[EMAIL PROTECTED]> a écrit : > On 17 Apr 2008, at 10:05, David BERCOT wrote: > > I've got a problem with DateTime. I have a short code which gives an > > error : > > > > > > $date = new DateTime(date("d/m/Y")); > > $date->modify("-1 month"); > > $mois_en_cours1 = $date->format("Y-m"); > > $date->modify("-1 month"); > > $mois_en_cours2 = $date->format("Y-m"); > > $date->modify("-1 month"); > > $mois_en_cours3 = $date->format("Y-m"); > > > > > > > > Fatal error: Class 'DateTime' not found in > > /var/www2/dacg_visio/index.html on line 244 > > > > > > If I look at the documentation : > > http://fr3.php.net/manual/fr/function.date-modify.php > > it seems to work if PHP version is above 5.1.0 (I am in 5.1.6 !). > > > > Do you have any idea about this error (Debian/Apache2) ? > > Do you have another way to obtain $mois_en_cours1, 2, 3 without > > DateTime ? > > Pre-5.2 you need to explicitly say you want the DateTime class. See > the note on this page: > http://fr3.php.net/manual/fr/datetime.installation.php > > Also note that it's experimental at the moment and therefore not > recommended for production usage. OK. So, my error is normal !!! Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Linux] PHP and SQL Server
Hi, I'd like to connect to SQL Server (it is MSDE from SQL Server 2000) from PHP. My system is Debian. I've installed FreeTDS and some dependencies... Here is my /etc/freetds/freetds.conf : [global] # TDS protocol version tds version = 4.2 [etemptation] host = 10.21.2.203 port = 1433 tds version = 8.0 Then, my /etc/odbc.ini : [etemptation] Description = TDS MSSQL Server Driver = /usr/lib/odbc/libtdsodbc.so Server = 10.21.2.203 Database = etemptation Port = 1433 TDS_Version = 8.0 And, my /etc/odbcinst.ini : [FreeTDS] Description = TDS driver (Sybase/MS SQL) Driver = /usr/lib/odbc/libtdsodbc.so Setup = /usr/lib/odbc/libtdsS.so CPTimeout = 5 CPReuse = 5 UsageCount = 1 My PHP test page is : But the result is : Warning: odbc_connect() [function.odbc-connect]: SQL error: [unixODBC][FreeTDS][SQL Server]Unable to connect to data source, SQL state S1000 in SQLConnect in /home/david.bercot/Internet/test_mssql.php on line 2 problem connexion I've also tried in a shell : p3010-ac-nantes:/home/david.bercot/Internet# isql -v etemptation src/tds/login.c: tds_connect: 10.21.2.203:1433: Connexion refusée [S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source [08S01][unixODBC][FreeTDS][SQL Server]Server is unavailable or does not exist. [ISQL]ERROR: Could not SQLConnect Do you have any idea for my problem ? Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Linux] PHP and SQL Server
Hi Mike, And thank you for your help... Le Mon, 21 May 2007 13:21:35 -0400, "Mike Smith" <[EMAIL PROTECTED]> a écrit : > On 5/21/07, David BERCOT <[EMAIL PROTECTED]> wrote: > > Hi Mike, > > > > Le Mon, 21 May 2007 10:24:52 -0400, > > "Mike Smith" <[EMAIL PROTECTED]> a écrit : > > > David, > > > > > > Is MSDE running in mixed mode authentication? I believe by > > > default it only uses Windows authentication. If you're not sure > > > you can readup on how to check (and change if necessary): > > > > > > http://support.microsoft.com/kb/325022 > > > > I've just had a look and MSDE is in mixed mode (2 !) :-( > > > > Thank you. > > > > David. > I vaguely remember having to add :1433 to the freetds.conf on one > Debian server. A quick google turns up this, but I think I put the > server:port on one line (i.e. 192.168.1.11:1433): > > http://lists.evolt.org/archive/Week-of-Mon-20030915/148291.html I've tried some modifications and I've searched for others ideas with Google, but nothing's right !!! I don't know at all what to do... May be a miracle if someone can help me ? Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Linux] PHP and SQL Server
Le Tue, 22 May 2007 14:18:31 +0200, Tijnema <[EMAIL PROTECTED]> a écrit : > On 5/22/07, David BERCOT <[EMAIL PROTECTED]> wrote: > > Hi Mike, > > > > And thank you for your help... > > > > Le Mon, 21 May 2007 13:21:35 -0400, > > "Mike Smith" <[EMAIL PROTECTED]> a écrit : > > > On 5/21/07, David BERCOT <[EMAIL PROTECTED]> wrote: > > > > Hi Mike, > > > > > > > > Le Mon, 21 May 2007 10:24:52 -0400, > > > > "Mike Smith" <[EMAIL PROTECTED]> a écrit : > > > > > David, > > > > > > > > > > Is MSDE running in mixed mode authentication? I believe by > > > > > default it only uses Windows authentication. If you're not > > > > > sure you can readup on how to check (and change if necessary): > > > > > > > > > > http://support.microsoft.com/kb/325022 > > > > > > > > I've just had a look and MSDE is in mixed mode (2 !) :-( > > > > > > > > Thank you. > > > > > > > > David. > > > I vaguely remember having to add :1433 to the freetds.conf on one > > > Debian server. A quick google turns up this, but I think I put the > > > server:port on one line (i.e. 192.168.1.11:1433): > > > > > > http://lists.evolt.org/archive/Week-of-Mon-20030915/148291.html > > > > I've tried some modifications and I've searched for others ideas > > with Google, but nothing's right !!! > > I don't know at all what to do... > > > > May be a miracle if someone can help me ? > > > > Thank you very much. > > > > David. > > Is the SQL server and the PHP script running on the same machine? If > so, you should specify 127.0.0.1 or localhost for the server, and not > the IP. No. SQL Server is under Windows XP and the PHP script is under Debian !!! David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [JS question] : I want to block onChange event in Firefox...
Hi, I am blocked on this problem since so a long time that I prefer asking here my question... I'd like, if the data isn't correct, that the user stay in the input zone. Everything is ok with IE but not with Firefox. Here is my code : // Validation des données. function demarrage_controles() { if (FF) { document.captureEvents(Event.KEYPRESS); document.captureEvents(Event.CHANGE); document.onkeypress = process_keypress; document.onchange = process_change; } else { document.onkeypress = process_keypress; for (i=0; i < document.forms[0].elements.length ; i++) { document.forms[0].elements[i].attachEvent("onchange",process_change); } } } // On n'accepte que des chiffres. function process_keypress(e) { if (FF) { if (e.target.tagName == "input" && !((e.which > 47 && e.which < 58) || e.which == 0 || e.which == 8 || e.which == 13)) { return false; } } else { if ((window.event.keyCode < 47 || window.event.keyCode > 58) && window.event.keyCode != 13) { return false; } } } // On compare au dernier cumul. function process_change(e) { if (FF) { if (e.target.id.substr(0,3) == "var" && e.target.alt != "") { if (Number(e.target.value) < Number(e.target.alt)) { alert ("Vous ne pouvez pas saisir de données inférieures au dernier cumul !"); e.preventDefault(); e.stopPropagation(); e.returnValue=false; } } } else { if (window.event.srcElement.id.substr(0,3) == "var" && window.event.srcElement.alt != "") { if (Number(window.event.srcElement.value) < Number(window.event.srcElement.alt)) { alert ("Vous ne pouvez pas saisir de données inférieures au dernier cumul !"); window.event.returnValue = false; } } } } My problem comes from the process_change function in Firefox where I put everything I know (stopPropagation etc...) but without success. The user go to the next field. In IE, the window.event.returnValue = false is ok. Do you have any clue ? Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [JS question] : I want to block onChange event in Firefox...
> Hi, > > did you try to open the javascript console in firefox to see if there is > any error ? > (in the "tools" or "outils" menu). Yes I did. No error... I was told to go to a JS list (here, it is a PHP one), so I'll look for one ;-) Thank you / merci. David. > hope this'll help / bon courage > > N F > > David BERCOT a écrit : > > Hi, > > > > I am blocked on this problem since so a long time that I prefer asking here > > my question... > > I'd like, if the data isn't correct, that the user stay in the input zone. > > Everything is ok with IE but not with Firefox. > > Here is my code : > > // Validation des données. > > function demarrage_controles() { > > if (FF) { > > document.captureEvents(Event.KEYPRESS); > > document.captureEvents(Event.CHANGE); > > document.onkeypress = process_keypress; > > document.onchange = process_change; > > } else { > > document.onkeypress = process_keypress; > > for (i=0; i < document.forms[0].elements.length ; i++) { > > > > document.forms[0].elements[i].attachEvent("onchange",process_change); > > } > > } > > } > > // On n'accepte que des chiffres. > > function process_keypress(e) { > > if (FF) { > > if (e.target.tagName == "input" && !((e.which > 47 && e.which < > > 58) || e.which == 0 || e.which == 8 || e.which == 13)) { > > return false; > > } > > } else { > > if ((window.event.keyCode < 47 || window.event.keyCode > 58) && > > window.event.keyCode != 13) { > > return false; > > } > > } > > } > > // On compare au dernier cumul. > > function process_change(e) { > > if (FF) { > > if (e.target.id.substr(0,3) == "var" && e.target.alt != "") { > > if (Number(e.target.value) < Number(e.target.alt)) { > > alert ("Vous ne pouvez pas saisir de données > > inférieures au dernier cumul !"); > > e.preventDefault(); > > e.stopPropagation(); > > e.returnValue=false; > > } > > } > > } else { > > if (window.event.srcElement.id.substr(0,3) == "var" && > > window.event.srcElement.alt != "") { > > if (Number(window.event.srcElement.value) < > > Number(window.event.srcElement.alt)) { > > alert ("Vous ne pouvez pas saisir de données > > inférieures au dernier cumul !"); > > window.event.returnValue = false; > > } > > } > > } > > } > > My problem comes from the process_change function in Firefox where I put > > everything I know (stopPropagation etc...) but without success. The user go > > to the next field. In IE, the window.event.returnValue = false is ok. > > > > Do you have any clue ? > > > > Thank you very much. > > > > David. > > > > > > > > --- > Orange vous informe que cet e-mail a ete controle par l'anti-virus mail. > Aucun virus connu a ce jour par nos services n'a ete detecte. > > > > [ (pas de nom de fichier) (0.1 Ko) ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/Oracle : bug with accent...
Hi, I have a big problem with my Debian server (Apache 2, PHP 5, Oracle Instant Client). I've modified the environment variable NLS_LANG and, with SQL*Plus, everything is ok ! But, in a PHP page, I can't insert a value with accent (ex: Irène). I can read data with accent, but not inserting !!! I searched all the afternoon, testing many solutions, without success. I think I'm not alone with this problem but... Do you have any clue ? Something to look at ? Thank you very much. David. signature.asc Description: Ceci est une partie de message numériquement signée
Re: [PHP] PHP/Oracle : bug with accent...
> > I have a big problem with my Debian server (Apache 2, PHP 5, Oracle > > Instant Client). I've modified the environment variable NLS_LANG and, > > with SQL*Plus, everything is ok ! But, in a PHP page, I can't insert a > > value with accent (ex: Irène). I can read data with accent, but not > > inserting !!! > > I searched all the afternoon, testing many solutions, without success. I > > think I'm not alone with this problem but... > > > > Do you have any clue ? Something to look at ? > > Try looking at the multi-byte string functions. Not sure if that would > help you or not though. OK. I've finally found the solution. Everything was ok except the Apache environment variables (NLS_LANG). Now, it works... Thank you. David. signature.asc Description: Ceci est une partie de message numériquement signée
[PHP] Bug Apache/PHP/Oracle on Debian
Hi, I have a server with Apache 2, PHP 5.1.1 and Oracle Instant Client 10.2.0.1. As I have a little bug [http://bugs.php.net/bug.php?id=29779], I've tried the solution (in oci8.c) and recompiled ! But then, everything was broken. So, I get the source of PHP 5.1.2 and recompiled again. Everything seems ok, with Apache and PHP, but it was impossible to use oci !!! I thought about an environment problem (LD_LIBRARY_PATH), but after some manipulations, I can see this variable in phpinfo(), but nothing about oci8 !!! I've looked into logs but I couldn't find any problem. It was like Oracle was not installed !!! So, I am completly blocked !!! Do you have any idea ? anu clue ? Thank you very much. David. signature.asc Description: Ceci est une partie de message numériquement signée
[PHP] PHP and LDAP...
Hi, I'm new on this list and with PHP. But I am a old web developer (with ASP). I'm looking for verifying a username/password in Active Directory with a LDAP request... I have this error : Warning: ldap_search() [function.ldap-search]: Search: Operations error in /var/www/ldap.html on line 69 I think my criterias are not OK but I think there are classical : $sr=ldap_search($ds,"o=Justice, c=FR","(sn=Berc*)"); Do you have a little example which always return an answer, in AD or in true LDAP (because I have two different servers) ? Then, I have another question... As I said, I'd like to verify username/password. Is it possible ? With AD ? With LDAP ? Is the password clear on network ? Do I have some solutions to resolve that problem ? Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and LDAP...
> David > > I found this resource usefull when authenticating users against LDAP, > its easy to set up and use. > > http://adldap.sourceforge.net/ OK. I have some problems but the most important point (verifying if a user can be authenticated) works well !!! Now, I have to adapt the script because I have different domains and, so, different servers... Thank you very much for this help ! David. > Ade > > David BERCOT wrote: > > >Hi, > > > >I'm new on this list and with PHP. But I am a old web developer (with > >ASP). > >I'm looking for verifying a username/password in Active Directory with a > >LDAP request... > >I have this error : > >Warning: ldap_search() [function.ldap-search]: Search: Operations error > >in /var/www/ldap.html on line 69 > > > >I think my criterias are not OK but I think there are classical : > >$sr=ldap_search($ds,"o=Justice, c=FR","(sn=Berc*)"); > > > >Do you have a little example which always return an answer, in AD or in > >true LDAP (because I have two different servers) ? > > > >Then, I have another question... As I said, I'd like to verify > >username/password. Is it possible ? With AD ? With LDAP ? > >Is the password clear on network ? Do I have some solutions to resolve > >that problem ? > > > >Thank you very much. > > > >David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] New identification after an error...
Hi, I use this program to force a user to authenticate : if (!isset($_SERVER["PHP_AUTH_USER"])) { header("WWW-Authenticate: Basic realm=\"Intranet SDSED\""); header("HTTP/1.1 401 Unauthorized"); } Everything is ok except a detail : if the user makes a mistake (for example, a bad password), the variable $_SERVER["PHP_AUTH_USER"] is initialised. So, if he wants to do again the above test, another identification won't happen (because $_SERVER["PHP_AUTH_USER"] is already set). I've tried : $_SERVER["PHP_AUTH_USER"] = NULL; without succes... Do you have a clue ? Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New identification after an error...
> David BERCOT wrote: > > I've tried : > > $_SERVER["PHP_AUTH_USER"] = NULL; > > without succes... > > http://www.php.net/unset > > e.g. unset($_SERVER['PHP_AUTH_USER']); > > It might, however, be better practice to used an authorisation state > variable, or something similar, i.e. > > if (! $auth) { > // HTTP Headers > } OK. Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Managing sessions...
Hi again, Ok, it's probably not the first time you have a question about sessions with PHP ;-) I've tried to read mails, documentation, searching on Internet but, finally, I think everything is not clear !!! First of all, I understand that, if session.auto_start is not on '1', I have to write session_start on each page I use !!! OK. Before this line, I put options : ini_set("session.use_only_cookies",1); ini_set("session.use_trans_sid",0); ini_set("error_reporting",E_ALL); and then : session_start(); I think it is very heavy to write... I read about ini_set("session.auto_start",1) but, on my server (Debian), it doesn't seem working... And I also read about options which can be not set if I use auto_start... So, I'd like to put my options (use_trans_sid, 0, etc...) and to have lite scripts. Is it possible ? Isn't there, like in asp, a global.asa where I can put all my parameters ? Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Managing sessions...
Hi, OK. I have many answers about managing sessions and I thank everyone. The best solution seems to be the inclusion of a file... But, I have just another question about all the options I have to put in this file... Is it necessary to do all of this (sorry for my commentaries which are in French) : // On demande à PHP d'utiliser des cookies pour gérer les sessions. ini_set("session.use_cookies","1"); // D'autre part, on précise que cette gestion des sessions sera faite uniquement via les cookies. ini_set("session.use_only_cookies","1"); // On désactive l'utilisation transparente du SID. ini_set("session.use_trans_sid","0"); // On précise le nombre de secondes après lesquelles le cookie de session sera détruit (si on met '0', // il sera effacé lors de la fermeture du navigateur). ini_set("cookie_lifetime","0"); // On précise la durée des pages liées à la session dans le cache (par défaut, 180 minutes). ini_set("session.cache_expire","24"); // ici, 24 minutes // On précise le nombre de secondes après lesquelles les fichiers de sessions gérés sur le serveur seront // considérés comme obsolètes et pourront donc être détruits automatiquement (voire ci-dessous). ini_set("session.gc_maxlifetime","1440"); // ici, 24 minutes // On précise la probabilité selon laquelle le nettoyage des fichiers obsolètes (voire ci-dessus) // s'effectue lors d'une sollicitation du serveur. Dans notre cas, 5 % (gc_probability/gc_divisor) // des requêtes seront accompagnées d'une suppression des fichiers obsolètes (garbage collector). // Toutefois, sous Debian, à cause de permissions strictes sur /var/lib/php5, ceci est désactivé ! // ini_set("session.gc_probability","5"); [à titre d'information] ini_set("session.gc_divisor","100"); // On précise le nom de notre session (pour permettre à des sous-applications d'utiliser // des sessions distinctes en gardant en tête la session de base). ini_set("session.name","SID_SDSED"); // On active la remontée de toutes les erreurs (en production, il faudra faire l'inverse !). ini_set("error_reporting",E_ALL | E_STRICT); // On affiche les éventuelles erreurs à l'écran (idem en production que ci-dessus). ini_set("display_errors","1"); // On lance la session session_start(); Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and DBase...
Hi, I'd like to connect to DBase files (.dbf) in order to do SQL requests. Do you know if it is possible ? If yes, do you have an example ? I'm working on Debian with PHP5. Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SQL in XML [was PHP and DBase...]
> > Hi, > > > > I'd like to connect to DBase files (.dbf) in order to do SQL requests. > > Do you know if it is possible ? > > If yes, do you have an example ? > > I'm working on Debian with PHP5. > > > > Thank you very much. > > > > David. > Blind? > > http://de.php.net/dbase OK. I should have made such a search ;-) So, it is possible... I'll try... But, finally, I wonder if I shouldn't use XML files instead ? Is it possible, directly, to make a SQL request on a XML file ? In fact, I was looking for a file format which would be modifing on Windows and on Linux. So, I thought about dbf. But now... Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL in XML [was PHP and DBase...]
> > > > Hi, > > > > > > > > I'd like to connect to DBase files (.dbf) in order to do SQL requests. > > > > Do you know if it is possible ? > > > > If yes, do you have an example ? > > > > I'm working on Debian with PHP5. > > > > > > > > Thank you very much. > > > > > > > > David. > > > Blind? > > > > > > http://de.php.net/dbase > > > >OK. I should have made such a search ;-) > >So, it is possible... I'll try... > > > >But, finally, I wonder if I shouldn't use XML files instead ? > >Is it possible, directly, to make a SQL request on a XML file ? > > > >In fact, I was looking for a file format which would be modifing on > >Windows and on Linux. So, I thought about dbf. But now... > > > >Thank you very much. > > > >David. > > > David, > > If I remember correctly, there are a lot of caveats surrounding .dbf files. > If it is data you have to manage, why not use MySQL / PostgresSQl / Firebird? In fact, it is only for one table. And I'd like a simple thing. For my data, I use Oracle !!! David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SQL in XML [was PHP and DBase...]
> > But, finally, I wonder if I shouldn't use XML files instead ? > > Is it possible, directly, to make a SQL request on a XML file ? > > How much data are you storing and how fast do you need it? > > If you're doing heavy "database" type queries, then just use mySQL. Yes, I use Oracle for my "real" data ;-) > XML is kind of a PITA to use IMHO. You have to set up DOM Objects and all > this crap, then loop over nodes and use xpaths and watch out for #text > elements and it's just messy. I'm forced to use XML for part of a project @ > work, and I'm always grateful when I can switch back to using a database and > SQL as God intended it to be. ;-p Hum, ok. XPaths is the only good solution to query an XML file (I am a newbie in this domain) ? > However, if you're just storing some basic configs or preferences, then I > would suggest looking into a much simpler (and universal): > > http://www.php.net/parse_ini_file Yes !!! Excellent !!! It is exactly what I need. I'd like to play with XML files, but, for my problem, your solution is perfect ! Thank you very much. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SQL request on DBase file...
Hi, I have to rewrite an application from ASP. In this application, I receive DBase files which may be saved into Oracle. In ASP, I used a generic driver and I made SQL requests on these files. It is possible with PHP on Linux ? Do you have some examples ? Thank you very much. David. signature.asc Description: Ceci est une partie de message numériquement signée
Re: [PHP] SQL request on DBase file...
> >Hi, > > > >I have to rewrite an application from ASP. In this application, I > >receive DBase files which may be saved into Oracle. > >In ASP, I used a generic driver and I made SQL requests on these files. > >It is possible with PHP on Linux ? > >Do you have some examples ? > > > >Thank you very much. > > > >David. > > Come on -- read the manual. There's a section .dbf files. Of course I read the manual !!! In fact, there's a section on .dbf files, but the request mode is sequentiel one... But I want to do SQL request !!! And my question is : is it possible with PHP on Linux ? It's easy on Windows with ASP but I don't know with PHP on Linux. I search a little bit before sending a mail on the list ;-) Thank you. David. signature.asc Description: Ceci est une partie de message numériquement signée
[PHP] [HS] IDE PHP on Linux...
Hi, I'm looking for a good IDE on Linux to code my php files... I'd like auto-completion (in php and html) and a file explorer... I've tested Eclipse (with PHP Eclipse) and Komodo but I couldn't have auto-completion on php commands !!! Do you have any idea ? Thank you very much. David. signature.asc Description: Ceci est une partie de message numériquement signée
RE: [PHP] [HS] IDE PHP on Linux...
Finally, I discovered that I need to have PHP and Apache on my computer in order than Eclipse may give me auto-complete... I'll install them tomorrow !!! Thank you. David. Le lundi 13 février 2006 à 15:42 -0600, Jay Blanchard a écrit : > [snip] > I'm looking for a good IDE on Linux to code my php files... I'd like > auto-completion (in php and html) and a file explorer... > I've tested Eclipse (with PHP Eclipse) and Komodo but I couldn't have > auto-completion on php commands !!! > Do you have any idea ? > [/snip] > > Are you sure that you have Eclipese set up properly...it auto-completes for > me on Linux. > signature.asc Description: Ceci est une partie de message numériquement signée
Re: [PHP] [HS] IDE PHP on Linux...
Hi, > Finally, I discovered that I need to have PHP and Apache on my computer > > in order than Eclipse may give me auto-complete... > > No you don't. Eclipse does code completion out-of-the-box w/out > installing additional software. Check your Preferences. If I check 'Preferences', then 'PHP Eclipse Web Development', then 'PHP', then 'Installed interpreters', there is nothing !!! But now, what do you mean by 'auto-complete' ? In fact, some people think they have to do CTRL+Space in order to have auto-complete. But in HTML, it is automatic ! I'd like to have the same thing in php. Is it possible ? Thank you. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php