php-windows Digest 23 Jul 2004 07:27:18 -0000 Issue 2330

Topics (messages 24242 through 24254):

Question about the Apache 2.0 Warning in the PHP manual on the PHP web site
        24242 by: Jim MacDiarmid
        24244 by: Justin Patrin
        24252 by: Jason Barnett

Re: Handling Linux directory paths in Win32
        24243 by: Justin Patrin

Enviar Attach via PHP
        24245 by: Gast�n Quiroga
        24246 by: Gerardo Rojas
        24247 by: Gast�n Quiroga
        24248 by: Gerardo Rojas
        24249 by: Tom Rogers
        24250 by: Tom Rogers
        24253 by: Jason Barnett

Re: Web site Templating (ie: patTemplate orSmarty)
        24251 by: Jason Barnett

CGI error on IIS
        24254 by: Odd Egil H. Selnes

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 ---
[ Exerp from PHP manual pages on website: 
"Warning Do not use Apache 2.0 and PHP in a production environment neither
on Unix nor on Windows." ]


Can anyone tell me what this means?  This is the only warning I see.


Thanks,
Jim



 

--- End Message ---
--- Begin Message ---
On Thu, 22 Jul 2004 10:40:33 -0400, Jim MacDiarmid
<[EMAIL PROTECTED]> wrote:
> 
> [ Exerp from PHP manual pages on website:
> "Warning Do not use Apache 2.0 and PHP in a production environment neither
> on Unix nor on Windows." ]
> 
> Can anyone tell me what this means?  This is the only warning I see.
> 

Please search the archives before posting, we were talking about this yesterday.
http://marc.theaimsgroup.com/?l=php-general&m=109021837828927&w=2

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

--- End Message ---
--- Begin Message --- Search the archives for this one - but basically there may/may not be third party thread issues.
--- End Message ---
--- Begin Message ---
On Thu, 22 Jul 2004 05:24:41 -0400, Jason Barnett <[EMAIL PROTECTED]> wrote:
> I actually use Apache so I knew it was safe for that, but didn't realize it
> would work for IIS as well (you just never know with Microsoft ;) ).  Good to
> know, thanks!
> 
> 

Windows claims POSIX compliance, so it's surprising how much works on
it. Then again, it's not surprising how many bugs there are...

> 
> 
> Paul Menard wrote:
> > Just a comment or thought on Jason's reply. I thought you could use '/' as the 
> > seperator and the
> > PHP engine would figure out based on the run-time OS what the actual path format 
> > would be. Hence
> > you can use actual path names like;
> >
> > E:/path1/path2/path3/somefile.php
> >
> > in your include and require statements.
> >
> > At least my code uses the '/' on these types of paths and works fine on Windows 
> > and *nix systems.
> > IIS and Apache both.
> >
> > FPM
> >
> > --- Jason Barnett <[EMAIL PROTECTED]> wrote:
> >
> >>I've run into this exact problem many times.  Two things:
> >>
> >>1) use the PEAR constant DIRECTORY_SEPERATOR, or define it yourself
> >>if (PHP_OS == 'Win32' || PHP_OS == 'WinNT') {
> >>   define('DIRECTORY_SEPERATOR', '\');
> >>} else {
> >>   define('DIRECTORY_SEPERATOR', '/');
> >>}
> >>
> >>2) I have two ways that I solve the relative include problem.
> >>   a) include_once dirname(__FILE__) . 'path/to/relative/include.php';
> >>
> >>   or for class libraries
> >>
> >>   b) function __autoload($class) {
> >>        // Use your own logic, I have mine defined to do PEAR-like loading
> >>        $file = str_replace('_', DIRECTORY_SEPERATOR, $class);
> >>        include_once($file . '.php');
> >>      }
> >>
> >>
> >>>As that would mean the macro code would not slow the linux
> >>>machine down at all when running the php script if it did
> >>>not even have to evaluate to see if it did need to run the
> >>>macro function, although I know php is a scripted language
> >>>and not compiled like C/C++ so I don't think its possible
> >>
> >>Note: PHP goes through the compile step, it's just that everything is compiled
> >>on demand.
> >>

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

--- End Message ---
--- Begin Message ---
Hola,
    es la primera vez que escribo a la lista, pero desde hace rato soy
    participante. La consulta es la siguiente.

    Yo estoy usando una class para enviar mails (con/sin attachments) via PHP que 
funciona
    perfecto cuando no env�o attachs o cuando en la linea de attach pongo
    "ruta/nombre" del archivo ej:

    $m->Attach( "c:/foo.txt", "text/plain", "foo.txt" );

    pero cuando quiero que tome la variable de archivo desde un formulario POST no me 
lo
    env�a: ej:

    $m->Attach ("$_POST['arhchiv']","text/plain", "foo.txt");

    tampoco funciona con $_FILE.

    Seguramente estoy teniendo un error conceptual pero no logro saber cual, me
    podr�an ayudar ??

    Gracias!!
    
 Gast�n.


8<--------------------------------------------

> On Thu, 22 Jul 2004 10:40:33 -0400, Jim MacDiarmid
> <[EMAIL PROTECTED]> wrote:
>> 
>> [ Exerp from PHP manual pages on website:
>> "Warning Do not use Apache 2.0 and PHP in a production environment neither
>> on Unix nor on Windows." ]
>> 
>> Can anyone tell me what this means?  This is the only warning I see.
>> 

> Please search the archives before posting, we were talking about this yesterday.
> http://marc.theaimsgroup.com/?l=php-general&m=109021837828927&w=2

> -- 
> DB_DataObject_FormBuilder - The database at your fingertips
> http://pear.php.net/package/DB_DataObject_FormBuilder

> paperCrane --Justin Patrin--





---------------------
12� Mandamiento Linux:
S� adulterar�s, y te har�s compatible
con cuantos sistemas se dejen
---------------------

--- End Message ---
--- Begin Message ---
Trata de, debug.  Estas seguro que $_POST['arhchiv'] tiene el variable correcto?  Si 
lo tiene bien, entonces trate esto

$fullpath = $_POST['archiv'];

$m->Attach( $fullpath, "text/plain", "foo.txt");

--
Gerardo S. Rojas
mailto: [EMAIL PROTECTED]


-----Original Message-----
From: Gast�n Quiroga [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 22, 2004 1:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Enviar Attach via PHP


Hola,
    es la primera vez que escribo a la lista, pero desde hace rato soy
    participante. La consulta es la siguiente.

    Yo estoy usando una class para enviar mails (con/sin attachments) via PHP que 
funciona
    perfecto cuando no env�o attachs o cuando en la linea de attach pongo
    "ruta/nombre" del archivo ej:

    $m->Attach( "c:/foo.txt", "text/plain", "foo.txt" );

    pero cuando quiero que tome la variable de archivo desde un formulario POST no me 
lo
    env�a: ej:

    $m->Attach ("$_POST['arhchiv']","text/plain", "foo.txt");

    tampoco funciona con $_FILE.

    Seguramente estoy teniendo un error conceptual pero no logro saber cual, me
    podr�an ayudar ??

    Gracias!!
    
 Gast�n.


8<--------------------------------------------

> On Thu, 22 Jul 2004 10:40:33 -0400, Jim MacDiarmid
> <[EMAIL PROTECTED]> wrote:
>> 
>> [ Exerp from PHP manual pages on website:
>> "Warning Do not use Apache 2.0 and PHP in a production environment neither
>> on Unix nor on Windows." ]
>> 
>> Can anyone tell me what this means?  This is the only warning I see.
>> 

> Please search the archives before posting, we were talking about this yesterday.
> http://marc.theaimsgroup.com/?l=php-general&m=109021837828927&w=2

> -- 
> DB_DataObject_FormBuilder - The database at your fingertips
> http://pear.php.net/package/DB_DataObject_FormBuilder

> paperCrane --Justin Patrin--





---------------------
12� Mandamiento Linux:
S� adulterar�s, y te har�s compatible
con cuantos sistemas se dejen
---------------------

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Gracias Gerardo por tu respuesta...

estuve investigando mas a fondo el problema y saqu� algunas conclusiones:

La l�nea de la clase es

$a-> Attach(<archivo>,<tipo_arch>, <modo_attach>)

donde <archivo> es el nombre del archivo con el fullpath, <tipo_arch> es el tipo de
attach (text/plain, application/rtf, etc) y <modo_attach> es la forma en que pega el 
attach al mensaje (opcional).

mi problema es que cuando posteo el form (POST) (cuya variable del campo FILE es
"archivo")

env�o lo siguiente

$a-> Attach($_FILE['archivo']['name'],$_FILE['archivo']['type'])


donde $_FILE['archivo']['name'] es, por ejemplo, foo.txt, cuando en realidad deber�a
ser c:\windows\escritorio\foo.txt. Creo que el problema est� en que no le puedo
pasar el PATH completo y por eso no lo puedo env�ar.


any advice??

gracias nuevamente !

-- 
Saludos,
 Gast�n.


8<--------------------------------------------

> Trata de, debug.  Estas seguro que $_POST['arhchiv'] tiene el variable
> correcto?  Si lo tiene bien, entonces trate esto

> $fullpath = $_POST['archiv'];

$m->>Attach( $fullpath, "text/plain", "foo.txt");

> --
> Gerardo S. Rojas
> mailto: [EMAIL PROTECTED]


> -----Original Message-----
> From: Gast�n Quiroga [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 22, 2004 1:46 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Enviar Attach via PHP


> Hola,
>     es la primera vez que escribo a la lista, pero desde hace rato soy
>     participante. La consulta es la siguiente.

>     Yo estoy usando una class para enviar mails (con/sin attachments) via PHP que 
> funciona
>     perfecto cuando no env�o attachs o cuando en la linea de attach pongo
>     "ruta/nombre" del archivo ej:

>     $m->Attach( "c:/foo.txt", "text/plain", "foo.txt" );

>     pero cuando quiero que tome la variable de archivo desde un formulario POST no 
> me lo
>     env�a: ej:

>     $m->Attach ("$_POST['arhchiv']","text/plain", "foo.txt");

>     tampoco funciona con $_FILE.

>     Seguramente estoy teniendo un error conceptual pero no logro saber cual, me
>     podr�an ayudar ??

>     Gracias!!
    
>  Gast�n.


> 8<--------------------------------------------

>> On Thu, 22 Jul 2004 10:40:33 -0400, Jim MacDiarmid
>> <[EMAIL PROTECTED]> wrote:
>>> 
>>> [ Exerp from PHP manual pages on website:
>>> "Warning Do not use Apache 2.0 and PHP in a production environment neither
>>> on Unix nor on Windows." ]
>>> 
>>> Can anyone tell me what this means?  This is the only warning I see.
>>> 

>> Please search the archives before posting, we were talking about this yesterday.
>> http://marc.theaimsgroup.com/?l=php-general&m=109021837828927&w=2

>> -- 
>> DB_DataObject_FormBuilder - The database at your fingertips
>> http://pear.php.net/package/DB_DataObject_FormBuilder

>> paperCrane --Justin Patrin--





> ---------------------
> 12� Mandamiento Linux:
> S� adulterar�s, y te har�s compatible
> con cuantos sistemas se dejen
> ---------------------





---------------------
12� Mandamiento Linux:
S� adulterar�s, y te har�s compatible
con cuantos sistemas se dejen
---------------------

--- End Message ---
--- Begin Message ---
Gaston,

lo que puedes hacer, es upload the file to the WebServer primero y luego call your 
function from there.  Cuando el Attachment, esta en el WebServer, puedes facil, 
manipular the file.

--
Gerardo S. Rojas
mailto: [EMAIL PROTECTED]


-----Original Message-----
From: Gast�n Quiroga [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 22, 2004 2:52 PM
To: [EMAIL PROTECTED]
Subject: Re[2]: [PHP-WIN] Enviar Attach via PHP


Gracias Gerardo por tu respuesta...

estuve investigando mas a fondo el problema y saqu� algunas conclusiones:

La l�nea de la clase es

$a-> Attach(<archivo>,<tipo_arch>, <modo_attach>)

donde <archivo> es el nombre del archivo con el fullpath, <tipo_arch> es el tipo de
attach (text/plain, application/rtf, etc) y <modo_attach> es la forma en que pega el 
attach al mensaje (opcional).

mi problema es que cuando posteo el form (POST) (cuya variable del campo FILE es
"archivo")

env�o lo siguiente

$a-> Attach($_FILE['archivo']['name'],$_FILE['archivo']['type'])


donde $_FILE['archivo']['name'] es, por ejemplo, foo.txt, cuando en realidad deber�a
ser c:\windows\escritorio\foo.txt. Creo que el problema est� en que no le puedo
pasar el PATH completo y por eso no lo puedo env�ar.


any advice??

gracias nuevamente !

-- 
Saludos,
 Gast�n.


8<--------------------------------------------

> Trata de, debug.  Estas seguro que $_POST['arhchiv'] tiene el variable
> correcto?  Si lo tiene bien, entonces trate esto

> $fullpath = $_POST['archiv'];

$m->>Attach( $fullpath, "text/plain", "foo.txt");

> --
> Gerardo S. Rojas
> mailto: [EMAIL PROTECTED]


> -----Original Message-----
> From: Gast�n Quiroga [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 22, 2004 1:46 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Enviar Attach via PHP


> Hola,
>     es la primera vez que escribo a la lista, pero desde hace rato soy
>     participante. La consulta es la siguiente.

>     Yo estoy usando una class para enviar mails (con/sin attachments) via PHP que 
> funciona
>     perfecto cuando no env�o attachs o cuando en la linea de attach pongo
>     "ruta/nombre" del archivo ej:

>     $m->Attach( "c:/foo.txt", "text/plain", "foo.txt" );

>     pero cuando quiero que tome la variable de archivo desde un formulario POST no 
> me lo
>     env�a: ej:

>     $m->Attach ("$_POST['arhchiv']","text/plain", "foo.txt");

>     tampoco funciona con $_FILE.

>     Seguramente estoy teniendo un error conceptual pero no logro saber cual, me
>     podr�an ayudar ??

>     Gracias!!
    
>  Gast�n.


> 8<--------------------------------------------

>> On Thu, 22 Jul 2004 10:40:33 -0400, Jim MacDiarmid
>> <[EMAIL PROTECTED]> wrote:
>>> 
>>> [ Exerp from PHP manual pages on website:
>>> "Warning Do not use Apache 2.0 and PHP in a production environment neither
>>> on Unix nor on Windows." ]
>>> 
>>> Can anyone tell me what this means?  This is the only warning I see.
>>> 

>> Please search the archives before posting, we were talking about this yesterday.
>> http://marc.theaimsgroup.com/?l=php-general&m=109021837828927&w=2

>> -- 
>> DB_DataObject_FormBuilder - The database at your fingertips
>> http://pear.php.net/package/DB_DataObject_FormBuilder

>> paperCrane --Justin Patrin--





> ---------------------
> 12� Mandamiento Linux:
> S� adulterar�s, y te har�s compatible
> con cuantos sistemas se dejen
> ---------------------





---------------------
12� Mandamiento Linux:
S� adulterar�s, y te har�s compatible
con cuantos sistemas se dejen
---------------------

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message --- Gast�N Quiroga wrote:
Gracias Gerardo por tu respuesta...

estuve investigando mas a fondo el problema y saqu� algunas conclusiones:

La l�nea de la clase es

$a-> Attach(<archivo>,<tipo_arch>, <modo_attach>)

donde <archivo> es el nombre del archivo con el fullpath, <tipo_arch> es el tipo de
attach (text/plain, application/rtf, etc) y <modo_attach> es la forma en que pega el 
attach al mensaje (opcional).

mi problema es que cuando posteo el form (POST) (cuya variable del campo FILE es
"archivo")

env�o lo siguiente

$a-> Attach($_FILE['archivo']['name'],$_FILE['archivo']['type'])


donde $_FILE['archivo']['name'] es, por ejemplo, foo.txt, cuando en realidad deber�a ser c:\windows\escritorio\foo.txt. Creo que el problema est� en que no le puedo pasar el PATH completo y por eso no lo puedo env�ar.


any advice??

gracias nuevamente !

You need to use $_FILES["archivo"]["tmp_name"] if you haven't moved the file.
--- End Message ---
--- Begin Message --- Gast�N Quiroga wrote:
Gracias Gerardo por tu respuesta...

estuve investigando mas a fondo el problema y saqu� algunas conclusiones:

La l�nea de la clase es

$a-> Attach(<archivo>,<tipo_arch>, <modo_attach>)

donde <archivo> es el nombre del archivo con el fullpath, <tipo_arch> es el tipo de
attach (text/plain, application/rtf, etc) y <modo_attach> es la forma en que pega el 
attach al mensaje (opcional).

mi problema es que cuando posteo el form (POST) (cuya variable del campo FILE es
"archivo")

env�o lo siguiente

$a-> Attach($_FILE['archivo']['name'],$_FILE['archivo']['type'])


donde $_FILE['archivo']['name'] es, por ejemplo, foo.txt, cuando en realidad deber�a ser c:\windows\escritorio\foo.txt. Creo que el problema est� en que no le puedo pasar el PATH completo y por eso no lo puedo env�ar.


any advice??

gracias nuevamente !

You need to use $_FILES["archivo"]["tmp_name"] if you haven't moved the file.
--- End Message ---
--- Begin Message ---
Hola,

Por favor perdoname mi espanol - hace tres anos que hable. Primero debe escribir a la lista espanol (hay mucha gente alli que hablen espanol):

php.general.es


Gast�N Quiroga wrote:

Hola,
    es la primera vez que escribo a la lista, pero desde hace rato soy
    participante. La consulta es la siguiente.

    Yo estoy usando una class para enviar mails (con/sin attachments) via PHP que 
funciona
    perfecto cuando no env�o attachs o cuando en la linea de attach pongo
    "ruta/nombre" del archivo ej:

    $m->Attach( "c:/foo.txt", "text/plain", "foo.txt" );

    pero cuando quiero que tome la variable de archivo desde un formulario POST no me 
lo
    env�a: ej:


Segundo, creo que su problema sea esto:

$m->Attach ("$_POST['arhchiv']","text/plain", "foo.txt");

Para $_POST debe usar {} o eliminar ". Por ejemplo: $m->Attach ($_POST['archiv'], 'text/plain', 'foo.txt'); $m->Attach("{$_POST['archiv']}", 'text/plain', 'foo.txt');

Es lo mismo para $_FILES. Buena suerte!
--- End Message ---
--- Begin Message ---
Jim Macdiarmid wrote:

Hi everyone,

I'm interested in taking the next step and learn templating. I've been
toying with one called patTemplate, however I'm a little confused by it. I
understand the concept, but I'm having trouble getting things to flow
correctly. Logic such as how to process forms, etc. I was wondering if any

Never used patTemplate... although in general templates work similar to the way PHP functions do. Bind a value to a variable and then plop it in the page. If your site only hires PHP programmers for design, or if you don't need to cache templates, then templating probably isn't needed. PHP after all started life as a templating language!


of you could be of help? PatTemplate looks like it's fairly straight
forward however there does seem to be very much activity from the looks of
the forum on the patTemplate web site. I was also thinking about taking a
look at smarty.

I like smarty mostly because of its caching feature. Most of the rest of it I can do without, indeed I still haven't bothered to learn all of the features it gives me. You can compare what you've seen with several other projects that do templating if you're interested in pursuing this further.

--- End Message ---
--- Begin Message ---
Hi.

When I use: header("Location: ".$_SERVER["PHP_SELF"]."?page=something");
I get a strange CGI error on IIS. This error occurs about 4 out of 10 times
i access the page.

It says "Bad request (INVALID VERB)" an errormsg wich does not explain
itself very well.

Ive tried to install a hotfix from microsoft that was supposed to fix this
problem, but nothing happened

My setup:
Windows 2003 Server, IIS 6, with php4.3.8


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.721 / Virus Database: 477 - Release Date: 16.07.2004

--- End Message ---

Reply via email to