php-windows Digest 1 Dec 2004 02:36:39 -0000 Issue 2490
Topics (messages 25081 through 25100):
LDAP:: undefined function: ldap_parse_reference
25081 by: Vincent DUPONT
Re: problem to open dir
25082 by: Gryffyn, Trevor
25083 by: Gryffyn, Trevor
25084 by: Gryffyn, Trevor
25085 by: Vincent DUPONT
25092 by: re_action
Re: Difference between Installer and ZIP?
25086 by: Gryffyn, Trevor
Re: Problemas con las igualdades
25087 by: Gryffyn, Trevor
25088 by: Gryffyn, Trevor
25090 by: Luis Moreira
Secure SMTP
25089 by: Charles P. Killmer
25098 by: Charles P. Killmer
While loops to build an array
25091 by: S.D.Price
25093 by: re_action
25094 by: S.D.Price
25095 by: re_action
MySQL 4.1 Server
25096 by: Dale Attree
25097 by: phpWalter
Re: HI! can u help me?
25099 by: Kurlic
Re: Permission deny on connecting MS Access database
25100 by: Emperor Kang Xi
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi,
I'm trying to use the ldap_parse_reference LDAP function.
I have the following error message :
Fatal error: Call to undefined function: ldap_parse_reference
I upgraded PHP from 4.3.4 to 4.3.9 (latest stable) but the problem remains.
Other ldap functions like ldap_connect or ldap_search do work properly.
I found some bug reports about this error, but I guess the missing functions
should have been added to the latest release...
I added the 2 dlls for ldap to work. Do I need to install something other for
these functions?
Any other idea?
Vincent
--- End Message ---
--- Begin Message ---
I think \' is going to quote the single-quote too. Best to quote the
backslashes I guess. Change all the \ to \\
Also.. Silly question.. But that directory DOES exist, right?
I assume the is_dir() line is 69 and the opendir() is line 70, correct?
-TG
> -----Original Message-----
> From: Mike [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 30, 2004 12:06 AM
> To: 'Pravin-Kumar'; [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] problem to open dir
>
>
> When you set the $dir variable, try doing so with single
> quotes - the \
> character is used to escape things and might be causing some problems.
>
> If that makes no sense, it's because I'm falling asleep.
>
> Good luck.
>
> -M
>
> > -----Original Message-----
> > From: Pravin-Kumar [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, November 30, 2004 12:37 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] problem to open dir
> >
> > hi all
> > i am getting some unexpected error while try to read a local dir..
> > it is working on the pc where apache is running ..but same
> > code not working while trying from other pcs in lan..
> > here is code..
> > $dir="C:\Documents and Settings\pravin\Desktop\abcd2"; if
> > (is_dir($dir)) {
> > if ($dh = opendir($dir)) {
> > while (($file = readdir($dh)) !== false) {
> > echo "filename: $file : filetype: " . filetype($dir
> > . $file) ."\n";
> > }
> > closedir($dh);
> > }
> > }
> >
> > $dir = dir($source);
> >
> >
> > giving error:
> > Warning: dir(C:\Documents and Settings\pravin\Desktop\cdac2):
> > failed to open dir: Invalid argument in
> > G:\Vyapar\AdvMgmt\addadvt3.php on line
> > 69
> >
> > Fatal error: Call to a member function on a non-object in
> > G:\Vyapar\AdvMgmt\addadvt3.php on line 70
--- End Message ---
--- Begin Message ---
Also.. Any permissions issues? Can PHP or the user that PHP is running
as access that folder?
> -----Original Message-----
> From: Pravin-Kumar [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 30, 2004 1:28 AM
> To: Mike
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] problem to open dir
>
>
>
> hi mike!
> $source='F:\cdac2';
> echo $source;
> if(is_dir($source)){echo "it is a dir.";}
> else{echo "it is not a dir..";}
>
>
> i had tried ur suggestion .. not working dude :(
> see i had one more thing .. it says "it is not a dir.."
> please help me list...........
>
> ---------
> Regards
> Pravin Kumar
--- End Message ---
--- Begin Message ---
Good call.. With the ~1 and all. Using short filenames/paths might help
sometime (when things have an issue with spaces in filenames).
To get short filenames and paths, use the "dir /x" command at a command
prompt.
Also.. Regarding the \ only sometimes giving issues... It'll only give
you a problem if it's followed by a letter or character that can be
escaped. The ones I can remember off the top of my head would be \" \t
\r \n and \' maybe.
Basically anything that the following functions fix for you:
Quotemeta()
Addslashes()
magic_quotes_gpc = On (in PHP.INI)
I see some others mentioned in Pattern Syntax for regular expressions
that I think are valid too:
http://www.php.net/manual/en/reference.pcre.pattern.syntax.php
And probably some other stuff I forgot (or just don't know).
I've used single backslashes for static file paths before and they
worked ok, then I added an extra path that happened to have something
like "C:\test" or something and the \t threw it off. So I just do \\
when I do file paths now... Just seems safer and less headache. Ugly
but safer.
-TG
> -----Original Message-----
> From: Armando [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 30, 2004 12:58 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] problem to open dir
>
>
> Try changing your $dir variable to:
>
> $dir="C:\\Documents and Settings\\pravin\\Desktop\\abcd2";
>
> Failing that, try using the Documents and Settings shortname:
>
> $dir="C:\Docume~1\pravin\Desktop\abcd2";
>
> Or:
>
> $dir="C:\\Docume~1\\pravin\\Desktop\\abcd2";
>
> If none of these work, perhaps also try them and replace the double
> quotes that enclose the string to single quotes.
>
> I ran into a lot of issues myself when trying to access the windows
> filesystem through PHP when using just single backslashes in my path
> variables because, as Mike noted, the \ is typically used to escape
> characters. In that case when PHP parses your $dir variable,
> it could be
> stripping out the \ thinking they are escaping the next characters. As
> soon as I used the double backslashes in my $dir variables on my own
> pages, everything worked fine. Mind you, I then got annoyed with some
> other Windows related issues so blew away my development box and put
> Linux on it instead :-) But I digress...
>
> Cheers.
>
> Armando
--- End Message ---
--- Begin Message ---
Hi,
I experienced the same problem some time ago.
Try to use \\remote_computer instead of a mounted drive (G:\).
Also, there is something like a BUG in is_dir().
The is_dir function does not return the good value for remote shares. Use
!is_file() instead of is_dir().
Make sure your script or the user running the script has access to the remote
drive. I use IIS to do this. Don't know for Apache but you must be able to run
the apache service with a specific user.
here is a code sample that works for me on paths like
//remote_computer/d$/Temp/ :
function getChildrenFiles($dir){
$output = array();
$files = array();
if((!is_file($dir))&&($dir_handle = opendir($dir))){
//use !is_file instead of is_dir because of a bug in is_dir with windows shares
while($file = readdir($dir_handle)){
if($file !== "." && $file !== ".."){
$files[] = $file;
}//if
}//while
closedir($dir_handle);
for($i=0; $i<sizeof($files);$i++){
$tmpFile = new
FileClass("$dir/".$files[$i]);
if (($tmpFile->isFile())
&&(isset($this->allowedExtensions))
&&(sizeof($this->allowedExtensions)>0)
&&(in_array($tmpFile->getExtension(), $this->allowedExtensions))){
$output[] = $tmpFile;
}
elseif(($tmpFile->isFile())&&((!isset($this->allowedExtensions))||(sizeof($this->allowedExtensions)==0))){
$output[] = $tmpFile;
}
else{
$tmpFile=NULL;
}
}//wfor
}//if
else{
//DEBUG //print("NOT DIR or NOT OPENABLE<br />");
}
reset($output);
return $output;
}
-----Original Message-----
From: Gryffyn, Trevor [mailto:[EMAIL PROTECTED]
Sent: mardi 30 novembre 2004 15:40
To: [EMAIL PROTECTED]
Cc: Mike; Pravin-Kumar
Subject: RE: [PHP-WIN] problem to open dir
I think \' is going to quote the single-quote too. Best to quote the
backslashes I guess. Change all the \ to \\
Also.. Silly question.. But that directory DOES exist, right?
I assume the is_dir() line is 69 and the opendir() is line 70, correct?
-TG
> -----Original Message-----
> From: Mike [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 30, 2004 12:06 AM
> To: 'Pravin-Kumar'; [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] problem to open dir
>
>
> When you set the $dir variable, try doing so with single
> quotes - the \
> character is used to escape things and might be causing some problems.
>
> If that makes no sense, it's because I'm falling asleep.
>
> Good luck.
>
> -M
>
> > -----Original Message-----
> > From: Pravin-Kumar [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, November 30, 2004 12:37 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] problem to open dir
> >
> > hi all
> > i am getting some unexpected error while try to read a local dir..
> > it is working on the pc where apache is running ..but same
> > code not working while trying from other pcs in lan..
> > here is code..
> > $dir="C:\Documents and Settings\pravin\Desktop\abcd2"; if
> > (is_dir($dir)) {
> > if ($dh = opendir($dir)) {
> > while (($file = readdir($dh)) !== false) {
> > echo "filename: $file : filetype: " . filetype($dir
> > . $file) ."\n";
> > }
> > closedir($dh);
> > }
> > }
> >
> > $dir = dir($source);
> >
> >
> > giving error:
> > Warning: dir(C:\Documents and Settings\pravin\Desktop\cdac2):
> > failed to open dir: Invalid argument in
> > G:\Vyapar\AdvMgmt\addadvt3.php on line
> > 69
> >
> > Fatal error: Call to a member function on a non-object in
> > G:\Vyapar\AdvMgmt\addadvt3.php on line 70
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello Vincent,
It'a bad way to do so, becouse the default sharing (like c$, d$,
admins$) could be turned off. This code, should work fine, if the
user, under witch php is running have permissions to access target
folder:
$dir="C:\\Documents and Settings\\pravin\\Desktop\\abcd2\\";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file : filetype: " . filetype($dir.$file) ."\n";
}
closedir($dh);
}
}
$dir = dir($source);
Also, on win32 system you have to use double slashes in path.
VD> Hi,
VD> I experienced the same problem some time ago.
VD> Try to use \\remote_computer instead of a mounted drive (G:\).
VD> Also, there is something like a BUG in is_dir().
VD> The is_dir function does not return the good value for remote
VD> shares. Use !is_file() instead of is_dir().
VD> Make sure your script or the user running the script has
VD> access to the remote drive. I use IIS to do this. Don't know for
VD> Apache but you must be able to run the apache service with a
VD> specific user.
VD> here is a code sample that works for me on paths like
//remote_computer/d$/Temp/ :
VD> function getChildrenFiles($dir){
VD> $output = array();
VD> $files = array();
VD> if((!is_file($dir))&&($dir_handle = opendir($dir))){
VD> //use !is_file instead of is_dir because of a bug in is_dir with windows
shares
VD> while($file = readdir($dir_handle)){
VD> if($file !== "." && $file !== ".."){
VD> $files[] = $file;
VD> }//if
VD> }//while
VD> closedir($dir_handle);
VD> for($i=0; $i<sizeof($files);$i++){
VD> $tmpFile = new
FileClass("$dir/".$files[$i]);
if (($tmpFile->>isFile())
VD>
&&(isset($this->allowedExtensions))
VD>
&&(sizeof($this->allowedExtensions)>0)
VD>
&&(in_array($tmpFile->getExtension(), $this->allowedExtensions))){
VD> $output[] = $tmpFile;
VD> }
VD>
elseif(($tmpFile->isFile())&&((!isset($this->allowedExtensions))||(sizeof($this->allowedExtensions)==0))){
VD> $output[] = $tmpFile;
VD> }
VD> else{
VD> $tmpFile=NULL;
VD> }
VD> }//wfor
VD> }//if
VD> else{
VD> //DEBUG //print("NOT DIR or NOT OPENABLE<br />");
VD> }
VD> reset($output);
VD> return $output;
VD> }
VD> -----Original Message-----
VD> From: Gryffyn, Trevor [mailto:[EMAIL PROTECTED]
VD> Sent: mardi 30 novembre 2004 15:40
VD> To: [EMAIL PROTECTED]
VD> Cc: Mike; Pravin-Kumar
VD> Subject: RE: [PHP-WIN] problem to open dir
VD> I think \' is going to quote the single-quote too. Best to quote the
VD> backslashes I guess. Change all the \ to \\
VD> Also.. Silly question.. But that directory DOES exist, right?
VD> I assume the is_dir() line is 69 and the opendir() is line 70, correct?
VD> -TG
>> -----Original Message-----
>> From: Mike [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, November 30, 2004 12:06 AM
>> To: 'Pravin-Kumar'; [EMAIL PROTECTED]
>> Subject: RE: [PHP-WIN] problem to open dir
>>
>>
>> When you set the $dir variable, try doing so with single
>> quotes - the \
>> character is used to escape things and might be causing some problems.
>>
>> If that makes no sense, it's because I'm falling asleep.
>>
>> Good luck.
>>
>> -M
>>
>> > -----Original Message-----
>> > From: Pravin-Kumar [mailto:[EMAIL PROTECTED]
>> > Sent: Tuesday, November 30, 2004 12:37 AM
>> > To: [EMAIL PROTECTED]
>> > Subject: [PHP-WIN] problem to open dir
>> >
>> > hi all
>> > i am getting some unexpected error while try to read a local dir..
>> > it is working on the pc where apache is running ..but same
>> > code not working while trying from other pcs in lan..
>> > here is code..
>> > $dir="C:\Documents and Settings\pravin\Desktop\abcd2"; if
>> > (is_dir($dir)) {
>> > if ($dh = opendir($dir)) {
>> > while (($file = readdir($dh)) !== false) {
>> > echo "filename: $file : filetype: " . filetype($dir
>> > . $file) ."\n";
>> > }
>> > closedir($dh);
>> > }
>> > }
>> >
>> > $dir = dir($source);
>> >
>> >
>> > giving error:
>> > Warning: dir(C:\Documents and Settings\pravin\Desktop\cdac2):
>> > failed to open dir: Invalid argument in
>> > G:\Vyapar\AdvMgmt\addadvt3.php on line
>> > 69
>> >
>> > Fatal error: Call to a member function on a non-object in
>> > G:\Vyapar\AdvMgmt\addadvt3.php on line 70
--
Best regards,
re_action mailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I like the manual install too. Plus, if the installer only contains the
CGI, then what happens if you end up wanting to write command line PHP
stuff? I'm assuming the CGI version requires integration with a web
server to function. Just some extra overhead and totally unnecessary if
you're just doing command line or WinBinder or GTK type stuff.
If anyone needs a really bare minimum PHP (which I wouldn't recommend
for someone just starting out), there's a link off of WinBinder's
download site to a minimal PHP distribution. I think it was only like
600kb for PHP4.
http://winbinder.sourceforge.net/download.php
-TG
> -----Original Message-----
> From: Arman
> Sent: Tuesday, November 30, 2004 1:02 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] Difference between Installer and ZIP?
>
>
> If you're looking for quick and dirty just to get it up and
> running fast
> to play with, then download the installer. It's that much smaller
> because it just doesn't include a lot of extras such as external
> extensions.
>
> I personally suggest the ZIP package and doing a manual install. There
> is documentation available to help you and there is much more
> bundled in
> the zip package that you don't have to go looking for if you end up
> needing it. Cheers.
>
> Armando
>
> -----Original Message-----
> From: Ian [mailto:[EMAIL PROTECTED]
> Sent: November 28, 2004 1:22 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Difference between Installer and ZIP?
>
>
> Hi there,
>
> Just went to php.net to download the installer/zip.
>
> I notice that the zip is quite large 7 megs or so... but the installer
> is
> only 2 megs..
>
> The installer says CGI ONLY, i quite a newbie at this and I
> just wish to
>
> install it on the server, what are the differences?
>
> The installer says it automatically configures IIS for me but the ZIP
> doesn't state that..
>
> Can anybody give any guidance on which method I should go for ??
>
> Thanks in advance
>
> Ian
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Tango:
---------------------------------------------
En espa�ol:
�Usted habla ingl�s? Mucha gente en esta lista habla solamente ingl�s y ella
puede no entender su pregunta. Estoy utilizando un software de la traducci�n
(Babelfish) para intentar ayudar.
Recomiendo el usar de la funci�n del file() para leer la l�nea del archivo uno
a la vez y para analizar la l�nea para ACTIVADO y DESACTIVADO. Puede ser que
sea m�s f�cil y puede trabajar mejor.
http://us2.php.net/manual/es/function.file.php
Utilice quiz� la funci�n del trim() tambi�n.
Si�ntase por favor libre escribirme si esta soluci�n no trabaja. Puedo intentar
ayudar. �Buena suerte!
---------------------------------------------
In English:
Do you speak english? Many people on this list only speak english and they may
not understand your question. I am using a translation software (Babelfish)
to try to help.
I recommend using the file() function to read the file one line at a time and
parse the line for ACTIVADO and DESACTIVADO. It might be easier and may work
better.
http://us2.php.net/manual/es/function.file.php
Maybe use the trim() function also.
Please feel free to write to me if this solution does not work. I can try to
help.
Good luck!
-TG
> -----Original Message-----
> From: T4NG0 [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 29, 2004 7:39 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Problemas con las igualdades
>
>
> Listeros:
>
> estoy tratando de establecer una igualdad y no logro comprender el
> funcionamiento, el c�digo es el siguiente.
>
> dado X archivos en mi directorio cuyo contenido puerde ser
> "ACTIVADO",
> "DESACTIVADO" o "NULO".
>
> yo debo determinar el contenido de ellos.
> el problema es que yo logro ver bien el contenido del archivo
> y lo puedo
> mostrar sin problemas (esa parte del script no la pasti�)
> pero lo que no
> puedo hacer es determinar el contenido del archivo (la linea
> IF $leer ==
> "ACTIVADO" me da o siempre falso o siempre verdadero pero
> nunca logro obtener
> un resultado coherente... ni con = ni con == ni con ===)
>
> alguna idea gente ??
>
> supongo que dada la hora mis neuronas ya no quieren funcionar
> y no veo cual es
> la pavada que me esta deteniendo...
>
>
> for ($x = 40; $x< 154; $x++)
> {
> [EMAIL PROTECTED]("./ws$x",'r');
> $leer = @fread($fp, 8192);
>
> settype($leer, "string");
>
> if ($leer=="ACTIVADO")
> {
> echo "ACTIVADO";
> } else {
> echo "DESACTIVADO";
> }
> }
>
>
> gracias y Saludos
>
>
> Gast�n.
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Sorry, the english link for file() is:
http://us2.php.net/manual/en/function.file.php
> -----Original Message-----
> From: Gryffyn, Trevor
> Sent: Tuesday, November 30, 2004 10:17 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] Problemas con las igualdades
>
>
> Tango:
>
> ---------------------------------------------
>
> En espa�ol:
> �Usted habla ingl�s? Mucha gente en esta lista habla
> solamente ingl�s y ella puede no entender su pregunta. Estoy
> utilizando un software de la traducci�n (Babelfish) para
> intentar ayudar.
>
> Recomiendo el usar de la funci�n del file() para leer la
> l�nea del archivo uno a la vez y para analizar la l�nea para
> ACTIVADO y DESACTIVADO. Puede ser que sea m�s f�cil y puede
> trabajar mejor.
> http://us2.php.net/manual/es/function.file.php
>
> Utilice quiz� la funci�n del trim() tambi�n.
>
> Si�ntase por favor libre escribirme si esta soluci�n no
> trabaja. Puedo intentar ayudar. �Buena suerte!
>
> ---------------------------------------------
>
> In English:
> Do you speak english? Many people on this list only speak
> english and they may not understand your question. I am
> using a translation software (Babelfish) to try to help.
>
> I recommend using the file() function to read the file one
> line at a time and parse the line for ACTIVADO and
> DESACTIVADO. It might be easier and may work better.
> http://us2.php.net/manual/es/function.file.php
>
> Maybe use the trim() function also.
>
> Please feel free to write to me if this solution does not
> work. I can try to help.
>
> Good luck!
>
>
> -TG
>
>
> > -----Original Message-----
> > From: T4NG0 [mailto:[EMAIL PROTECTED]
> > Sent: Monday, November 29, 2004 7:39 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] Problemas con las igualdades
> >
> >
> > Listeros:
> >
> > estoy tratando de establecer una igualdad y no logro comprender el
> > funcionamiento, el c�digo es el siguiente.
> >
> > dado X archivos en mi directorio cuyo contenido puerde ser
> > "ACTIVADO",
> > "DESACTIVADO" o "NULO".
> >
> > yo debo determinar el contenido de ellos.
> > el problema es que yo logro ver bien el contenido del archivo
> > y lo puedo
> > mostrar sin problemas (esa parte del script no la pasti�)
> > pero lo que no
> > puedo hacer es determinar el contenido del archivo (la linea
> > IF $leer ==
> > "ACTIVADO" me da o siempre falso o siempre verdadero pero
> > nunca logro obtener
> > un resultado coherente... ni con = ni con == ni con ===)
> >
> > alguna idea gente ??
> >
> > supongo que dada la hora mis neuronas ya no quieren funcionar
> > y no veo cual es
> > la pavada que me esta deteniendo...
> >
> >
> > for ($x = 40; $x< 154; $x++)
> > {
> > [EMAIL PROTECTED]("./ws$x",'r');
> > $leer = @fread($fp, 8192);
> >
> > settype($leer, "string");
> >
> > if ($leer=="ACTIVADO")
> > {
> > echo "ACTIVADO";
> > } else {
> > echo "DESACTIVADO";
> > }
> > }
> >
> >
> > gracias y Saludos
> >
> >
> > Gast�n.
--- End Message ---
--- Begin Message ---
I do speak Spanish, but for the sake of everyone who doesn't, let's keep
the English :-)
1) Drop the comparison using "==", since you are comparing strings
2) Use STRCMP instead
3) Since this function is "case sensitive", maybe it's best to convert
the string to upper case, and compare it after
My suggestion is (not tested) :
$leer = strtoupper($leer);
Also remove trailing and leading spaces
$leer = trim($leer);
Now check...
$result = strcmp($leer,"ACTIVADO")
if ($result == 0)
{
// Activado
}
else
{
// No activado
}
FROM THE DOCS
trcmp -- Binary safe string comparison
Description
int *strcmp* ( string str1, string str2)
Returns < 0 if str1 is less than str2; > 0 if str1 is greater than str2,
and 0 if they are equal.
Luis
Gryffyn, Trevor wrote:
Tango:
---------------------------------------------
En espa�ol:
�Usted habla ingl�s? Mucha gente en esta lista habla solamente ingl�s y ella
puede no entender su pregunta. Estoy utilizando un software de la traducci�n
(Babelfish) para intentar ayudar.
Recomiendo el usar de la funci�n del file() para leer la l�nea del archivo uno
a la vez y para analizar la l�nea para ACTIVADO y DESACTIVADO. Puede ser que
sea m�s f�cil y puede trabajar mejor.
http://us2.php.net/manual/es/function.file.php
Utilice quiz� la funci�n del trim() tambi�n.
Si�ntase por favor libre escribirme si esta soluci�n no trabaja. Puedo intentar
ayudar. �Buena suerte!
---------------------------------------------
In English:
Do you speak english? Many people on this list only speak english and they may
not understand your question. I am using a translation software (Babelfish)
to try to help.
I recommend using the file() function to read the file one line at a time and
parse the line for ACTIVADO and DESACTIVADO. It might be easier and may work
better.
http://us2.php.net/manual/es/function.file.php
Maybe use the trim() function also.
Please feel free to write to me if this solution does not work. I can try to
help.
Good luck!
-TG
-----Original Message-----
From: T4NG0 [mailto:[EMAIL PROTECTED]
Sent: Monday, November 29, 2004 7:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Problemas con las igualdades
Listeros:
estoy tratando de establecer una igualdad y no logro comprender el
funcionamiento, el c�digo es el siguiente.
dado X archivos en mi directorio cuyo contenido puerde ser
"ACTIVADO",
"DESACTIVADO" o "NULO".
yo debo determinar el contenido de ellos.
el problema es que yo logro ver bien el contenido del archivo
y lo puedo
mostrar sin problemas (esa parte del script no la pasti�)
pero lo que no
puedo hacer es determinar el contenido del archivo (la linea
IF $leer ==
"ACTIVADO" me da o siempre falso o siempre verdadero pero
nunca logro obtener
un resultado coherente... ni con = ni con == ni con ===)
alguna idea gente ??
supongo que dada la hora mis neuronas ya no quieren funcionar
y no veo cual es
la pavada que me esta deteniendo...
for ($x = 40; $x< 154; $x++)
{
[EMAIL PROTECTED]("./ws$x",'r');
$leer = @fread($fp, 8192);
settype($leer, "string");
if ($leer=="ACTIVADO")
{
echo "ACTIVADO";
} else {
echo "DESACTIVADO";
}
}
gracias y Saludos
Gast�n.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Does anyone know of a class or something to send email with smtps?
Thanks
Charles Killmer
--- End Message ---
--- Begin Message ---
Not to nitpick but my message said SMTPS. For SMTP Secure. I would be
interested in taking a look at your class when complete.
Does anyone else have ideas about SMTPS?
Charles
-----Original Message-----
From: phpWalter [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 30, 2004 2:22 PM
To: Charles P. Killmer
Subject: re: [PHP-WIN] Secure SMTP
So many conditional questions...
your SUBJECT states "Secure SMTP"
your message just says "SMTP"
Are you looking for plain or Secure?
If plain, php.net/mail
If your looking for Secure SMTP, give me a few days and I'll send you my
class I'm working on. I need a tester anyway! ;)
If your interested.
Walter
Does anyone know of a class or something to send email with smtps?
Thanks
Charles Killmer
--- End Message ---
--- Begin Message ---
Hi, I wonder if you could help. I am trying to build a php based
calendar for a news blog. The calendar should create hyperlinks directly
to a news story. However in order to do this I need to create a $days
array which takes the date value of the story submitted and the id of
the story and creates a dynamic link.
Howver I am finding it difficult to generate the array using a while
loop - do you know a better way?.
if (mysql_num_rows($result3) > 0) {
$days = array(
while ($row = mysql_fetch_array($result3)) {
date(j,
$row3['entry_date'])=>array($row3['newsid']),;
}
);
}
else {
echo "<p>The array has not been built.</p>";
}
echo generate_calendar($year, $month, $days);
Thanks
Steven
--- End Message ---
--- Begin Message ---
Hello S.D.Price,
Your syntax is not correct, try this, instead:
if (mysql_num_rows($result3) > 0){
while ($row = mysql_fetch_array($result3)) {
$days[date(j,$row3['entry_date'])] = $row3['newsid'];
};
}
else {
echo "<p>The array has not been built.</p>";
};
SDP> Hi, I wonder if you could help. I am trying to build a php based
SDP> calendar for a news blog. The calendar should create hyperlinks directly
SDP> to a news story. However in order to do this I need to create a $days
SDP> array which takes the date value of the story submitted and the id of
SDP> the story and creates a dynamic link.
SDP> Howver I am finding it difficult to generate the array using a while
SDP> loop - do you know a better way?.
SDP> if (mysql_num_rows($result3) > 0) {
SDP> $days = array(
SDP> while ($row = mysql_fetch_array($result3)) {
SDP> date(j,
SDP> $row3['entry_date'])=>array($row3['newsid']),;
SDP> }
SDP> );
SDP> }
SDP> else {
SDP> echo "<p>The array has not been built.</p>";
SDP> }
SDP> echo generate_calendar($year, $month, $days);
SDP> Thanks
SDP> Steven
--
Best regards,
re_action mailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi thanks but this gives:
$days[date] = id;
What I need is a multidimensional array in the form
$days = array([date]=>array(id),)
Do you know how to do this?
thanks
Steve
-----Original Message-----
From: re_action [mailto:[EMAIL PROTECTED]
Sent: 30 November 2004 17:10
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] While loops to build an array
Hello S.D.Price,
Your syntax is not correct, try this, instead:
if (mysql_num_rows($result3) > 0){
while ($row = mysql_fetch_array($result3)) {
$days[date(j,$row3['entry_date'])] = $row3['newsid'];
};
}
else {
echo "<p>The array has not been built.</p>";
};
SDP> Hi, I wonder if you could help. I am trying to build a php based
SDP> calendar for a news blog. The calendar should create hyperlinks
SDP> directly to a news story. However in order to do this I need to
SDP> create a $days array which takes the date value of the story
SDP> submitted and the id of the story and creates a dynamic link.
SDP> Howver I am finding it difficult to generate the array using a
SDP> while loop - do you know a better way?.
SDP> if (mysql_num_rows($result3) > 0) {
SDP> $days = array(
SDP> while ($row = mysql_fetch_array($result3)) {
SDP> date(j,
SDP> $row3['entry_date'])=>array($row3['newsid']),;
SDP> }
SDP> );
SDP> }
SDP> else {
SDP> echo "<p>The array has not been built.</p>";
SDP> }
SDP> echo generate_calendar($year, $month, $days);
SDP> Thanks
SDP> Steven
--
Best regards,
re_action mailto:[EMAIL PROTECTED]
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello S.D.Price,
Sorry, but i can't clearly understand, what do you mean by this:
SDP> $days = array([date]=>array(id),)
if every $days[date] should contains array of id's you should use
this:
$days[date(j,$row3['entry_date'])][] = $row3['newsid'];
SDP> Hi thanks but this gives:
SDP> $days[date] = id;
SDP> What I need is a multidimensional array in the form
SDP> $days = array([date]=>array(id),)
SDP> Do you know how to do this?
SDP> thanks
SDP> Steve
SDP> -----Original Message-----
SDP> From: re_action [mailto:[EMAIL PROTECTED]
SDP> Sent: 30 November 2004 17:10
SDP> To: [EMAIL PROTECTED]
SDP> Subject: Re: [PHP-WIN] While loops to build an array
SDP> Hello S.D.Price,
SDP> Your syntax is not correct, try this, instead:
SDP> if (mysql_num_rows($result3) > 0){
SDP> while ($row = mysql_fetch_array($result3)) {
SDP> $days[date(j,$row3['entry_date'])] = $row3['newsid'];
SDP> };
SDP> }
SDP> else {
SDP> echo "<p>The array has not been built.</p>";
SDP> };
SDP>> Hi, I wonder if you could help. I am trying to build a php based
SDP>> calendar for a news blog. The calendar should create hyperlinks
SDP>> directly to a news story. However in order to do this I need to
SDP>> create a $days array which takes the date value of the story
SDP>> submitted and the id of the story and creates a dynamic link.
SDP>> Howver I am finding it difficult to generate the array using a
SDP>> while loop - do you know a better way?.
SDP>> if (mysql_num_rows($result3) > 0) {
SDP>> $days = array(
SDP>> while ($row = mysql_fetch_array($result3)) {
SDP>> date(j,
SDP>> $row3['entry_date'])=>array($row3['newsid']),;
SDP>> }
SDP>> );
SDP>> }
SDP>> else {
SDP>> echo "<p>The array has not been built.</p>";
SDP>> }
SDP>> echo generate_calendar($year, $month, $days);
SDP>> Thanks
SDP>> Steven
SDP> --
SDP> Best regards,
SDP> re_action mailto:[EMAIL PROTECTED]
--
Best regards,
re_action mailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi
Does anyone know where I can download the latest MySQL PHP API to connect to
MySQL 4.1?
Kind Regards,
Dale Attree (NDECS)
Technical Manager - Kwik IT Solutions
www.kwikitsolutions.co.za
Tel : +27 35 786 1416
Cel : +27 83 407 2911
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
> Does anyone know where I can download the latest MySQL PHP API to connect
> to MySQL 4.1?
Best API out there...
http://adodb.sourceforge.net/
walter
--- End Message ---
--- Begin Message ---
ok thank you!
^_^
-------------------------
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I use MySQL for PHP and I need to retrieve data from MDB directly and display it to user browser. If php possible to retrive mdb data, so i do not need to write converter for MDB to MySQL.
Why MDB + MySQL for PHP? VB --> MDB ---> running application PHP --> MySQL and a view tables in MDB --> new development have different purpose with VB application
<[EMAIL PROTECTED]> Re: Re: [PHP-WIN] Permission deny on connecting MS Access database always check the lock status of ur MDB files there
btw why r u using MDB with PHP, while u can use db server like mysql,
postgres or even oracle with easier configuration and better security
|