php-windows Digest 20 Sep 2006 09:00:43 -0000 Issue 3040
Topics (messages 27157 through 27161):
A problem writting to a file
27157 by: German Piqué
27159 by: SMITHT
27160 by: Mikael Krogius \(Winwap Technologies\)
Date problem
27158 by: German Piqué
27161 by: Mikael Krogius \(Winwap Technologies\)
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 ---
Well... I am making a class that realizes the efects of a logging system, in
order to be able to debug my scripts that works with cookies, but I foun a
problem.
I don't know if its a windows php version problem, but when I try to insert
the newline caracter: '\' like this:
fputs($this->fileID,'\n');
it writes "\n" instead of creating a new line...
the ugly result is something like this:
Beginning the logging at:\nPrueba de insertar texto sin abrir el archivo a
mano.\nA ver si lo inserta con un retorno de carro\n Beginning the logging
at:\nPrueba de insertar texto sin abrir el archivo a mano.\nA ver si lo
inserta con un retorno de carro\n Beginning the logging at:\nPrueba de
insertar texto sin abrir el archivo a mano.\nA ver si lo inserta con un
retorno de carro\n Beginning the logging at:\n
Anyone had this problem?
--- End Message ---
--- Begin Message ---
fputs($this->fileID,"\n");
Note the "", instead of ''.
Tom
-----Original Message-----
From: German Piqué [mailto:[EMAIL PROTECTED]
Sent: 20 September 2006 09:37
To: php-windows
Subject: [PHP-WIN] A problem writting to a file
Well... I am making a class that realizes the efects of a logging system, in
order to be able to debug my scripts that works with cookies, but I foun a
problem.
I don't know if its a windows php version problem, but when I try to insert
the newline caracter: '\' like this:
fputs($this->fileID,'\n');
it writes "\n" instead of creating a new line...
the ugly result is something like this:
Beginning the logging at:\nPrueba de insertar texto sin abrir el archivo a
mano.\nA ver si lo inserta con un retorno de carro\n Beginning the logging
at:\nPrueba de insertar texto sin abrir el archivo a mano.\nA ver si lo
inserta con un retorno de carro\n Beginning the logging at:\nPrueba de
insertar texto sin abrir el archivo a mano.\nA ver si lo inserta con un
retorno de carro\n Beginning the logging at:\n
Anyone had this problem?
--- End Message ---
--- Begin Message ---
> I don't know if its a windows php version problem, but when I
> try to insert
> the newline caracter: '\' like this:
>
> fputs($this->fileID,'\n');
>
> it writes "\n" instead of creating a new line...
Try doing this:
$RowToWrite = $WriteThis."\r\n";
- Mikael
--- End Message ---
--- Begin Message ---
Like in the other mail, I have another problem with my logging class...
I'm trying to get the current date to write it in each line it's writed but
the process is stopped when I try to access the hours, the minutes or the
seconds.
$now = getdate();
$stringNow = $now["year"] . $now["month"] . $now["mday"] . " - "
/*$now["hours"] . ":" . $now["minutes"] . ":" . $now["seconds"]*/;
The commented code is the one that causes the execution to break. I compared
the keys with the ones on the getdate's documentation page and they're the
same...
Anyone had this problem and know anything of it?
Thanks :)
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: German Piqué
>
> $now = getdate();
> $stringNow = $now["year"] . $now["month"] . $now["mday"] . " - "
> /*$now["hours"] . ":" . $now["minutes"] . ":" . $now["seconds"]*/;
Have you tried doing something like this:
$stringNow = date('Ymd').' - '.date('H:i:s');
- Mikael
--- End Message ---