php-windows Digest 4 Nov 2002 18:29:54 -0000 Issue 1423

Topics (messages 16715 through 16725):

Re: 2 Issues for Mail() in Win/PHP4-
        16715 by: Steve Yates
        16717 by: Marie Monday
        16718 by: Marie Monday
        16724 by: Dash McElroy

PHP.INI Configuration Problems
        16716 by: Ronny

fsockopen fails if port blocked by firewall - PHP 4.0.6 / Apache / Linux
        16719 by: neil smith

PHP4.3 with Dav and Apache2
        16720 by: Alex

Re: is_file() can't tell the difference between file and directory in Win32...
        16721 by: Jack Kelly Dobson
        16722 by: Alexander Kuznetsov
        16725 by: Jack Kelly Dobson

Windows Stop error and PHP
        16723 by: Cynthia Blue

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 ---
"Marie Monday" <[EMAIL PROTECTED]> wrote in message
news:3DC3F4BB.D40352A5@;nomail.net...
> I'm a PHP newbie and have just installed php4.2.3

    Earlier versions of 4.x would auto-create variables for you.  4.2 no
longer does that.  Your Apache server is probably using an older version of
PHP, or has register_globals turned on.  Use

$variable = $_POST['variable'];  // or
echo $_POST['variable'];

or, extract($_POST) or extract($HTTP_POST_VARS) to create all POSTed
variables.

 - Steve Yates
 - Wicked witch parking only -- Violators will be toad.

~ Do you like my taglines? Add them to your messages and
~ laugh through hundreds more by downloading Taglinator
~ at www.srtware.com today!


--- End Message ---
--- Begin Message ---
Thanks everyone for the good responses.  I'm learning alot just reading
through!
~marie

Marie Monday wrote:

> I'm a PHP newbie and have just installed php4.2.3 on WinNT 4.0 w/ IIS4.0
>
> Already have set the SMTP and sendmail_from in php.ini.
> 1). Mail function sends mail, except that none of the html form
> variables are parsed into the email body $message.
> The script  works fine run from another hosted (apache) webserver.   Is it
>
> a config or script issue?
> 2). Received email message does not include the sender's email address
> from $txtemail form variable.
> Instead, it places their email address from the form in the message body
> first line.
> It is using the php.ini sendmail_from address.
>
> <?php
> {
> $recipient="[EMAIL PROTECTED]";
> $subject="Need Help";
> $message="$txtname submitted a helpdesk request by web form.
> A computer tech needs to contact $txtname shortly at $txtphone or by
> email at $txtemail regarding $txtproblem";
> $sender=$txtemail;
> mail(trim($recipient), trim($subject), $message, trim($sender));
> }
> ?>
>
> TIA,
> ~marie

--



**************************************************************************

E-mail correspondence to and from this address may be subject to the
North Carolina Public Records Law and may be disclosed to third parties.

**************************************************************************

--- End Message ---
--- Begin Message ---
I've been scanning the list msgs trying to figure out why that's discouraged.  Anyone 
know why?

"Charles P. Killmer" wrote:

> Also check and make sure that you have register_globals set to on in php.ini  Some 
>argue that you shouldn't use that though.
>
> Charles Killmer
>
> -----Original Message-----
--- End Message ---
--- Begin Message ---
Read this link: http://www.php.net/manual/en/security.registerglobals.php

Having register_globals set to on can make it easier for someone to exploit
poorly written code (there are examples on the page).

I like to use register_globals=off too because I know explicitly where each
variable is coming from (i.e. POST, GET, COOKIE, SESSION, etc).

-Dash

-----Original Message-----
From: Marie Monday [mailto:Marie.Monday@;ncmail.net] 
Sent: Monday, November 04, 2002 6:11 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] 2 Issues for Mail() in Win/PHP4-


I've been scanning the list msgs trying to figure out why that's
discouraged.  Anyone know why?

"Charles P. Killmer" wrote:

> Also check and make sure that you have register_globals set to on in
php.ini  Some argue that you shouldn't use that though.
>
> Charles Killmer
>
> -----Original Message-----

--- End Message ---
--- Begin Message ---
Hi,

i think i need some help to configure my php.ini. All php apps don't work so
i want. Can somebody help me to make a proper configuration on a w2k server?
Please write me to [EMAIL PROTECTED] so i can send you my php.ini file.
Thank you verry much!

Ronny


--- End Message ---
--- Begin Message --- Hello List -

I am having a problem with fsockopen since my ISP upgraded their linux server. The same function works just fine on another linux server and PHP version (using a different ISP).

This fsockopen function previously worked as expected, returning within the specified timeout (2 sec) if a socket connection attempt to client is rejected, eg by a firewall.
For connection to port 1720, (then immediate close of socket if fsockopen returns true) I use :

$fsock=fsockopen( $address, 1720 , &$errno, &$errmesg , 2);

I have also tried 2.0 (float) rather than 2 as per PHP manual, this makes no difference.
http://www.php.net/manual/en/function.fsockopen.php

The specific symptoms :

No listener on client port 1720 : Succeeds
Listening client socket on port 1720 Succeeds
Client firewall configured to allow connections Succeeds
Client firewall configured to deny connections Fails

The fail mode is that fsockopen does *not* return after the specified timeout, and the script itself eventually times out at the default 30 sec.

Working configuration : PHP 4.1.2, Linux Redhat 2.2.20, Apache 1.3.22
Http Env vars :i386-redhat-linux-gnu

Non-working configuration : PHP 4.0.6, Linux Redhat 2.4.9-21smp i686, Apache 1.3.27
Http Env vars : i386-slackware-linux-gnu

Anybody able to offer any help or point me at a way to step round this problem ? I thought of setting up an XML feed by HTTP Post from one machine to another - they are on diffrent networks so I worry about latency.

Thanks for any help or suggestions to fix this problem, or any anecdotal evidence I can use to fix it !!

Neil Smith.

--- End Message ---
--- Begin Message ---
Hello.
Here is the question:

I have apache 2 and php4.3 installed as cgi script (not an apache2 module),
so, in apache2 config i've create a webDir, it normally works from IE,
so, then a've load apache2 mod_dav and it starts working too (from Network
Places i can add this folder).
Now, the question itself, how i can add control of this folder to PHP ?
i mean, it is possible to emulate WebDAV protocol using php ?
So it will be as dynamic content of the folder not an actual dav directory.
In other words, i need to pass dav requests from apache to php?
Give me some idea how i can do thah ?

Big thanks.

Sorry for my english, just teaching...


--- End Message ---
--- Begin Message ---
I answered my own question with a little digging on the PHPBuilder page...

is_file() and is_dir() will report everything as a directory unless you
first chdir() to the directory. After I added the chdir() it worked. Anyone
know if that's going to be changed in the future?

(I love recursion!)

<?
function Check_For_Slash($path) {
   if (substr($path, (strlen($path) - 1), 1) != "/") {
      $path = $path . "/";
   }
   return($path);
}
function Get_Directory_Listing($path) {
   $base_dir = "/inetpub/wwwroot"; // all paths will be relative to
webserver
   $base_dir = Check_For_Slash($base_dir);
   if ($dir_handle = opendir($base_dir . $path)) {
      while ($file = readdir($dir_handle)) {
         $path = Check_For_Slash($path);
         chdir($base_dir . $path);
         if (($file != ".") && ($file != "..")) {
            if (is_dir($file)) {
               chdir($base_dir . $path . $file);
               print($file . "<DIR>\n");
               Get_Directory_Listing($path . $file);
               print("</DIR>\n");
            }
            elseif (is_file($file)) {
               print("<A HREF='" . $path . $file . "'>" . $file .
"</A><BR>\n");
            }
            else {
               print("I don't know what " . $file . " is. <BR>\n");
           }
         }
      }
   closedir($dir_handle);
   }
}
Get_Directory_Listing("/somedir/public");
?>

j-

"Miha Nedok" <[EMAIL PROTECTED]> wrote in message
news:20021101235019.I23837-100000@;voyager.zrcalo.si...
>
> I had similar problems. Use strcmp() with .. and . .
> Or use filetype() to determine if it is a file or directory or ...
>
>
> Mike
>
>
> On Fri, 1 Nov 2002, Jack Kelly Dobson wrote:
>
> > Date: Fri, 1 Nov 2002 16:39:55 -0600
> > From: Jack Kelly Dobson <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] is_file() can't tell the difference between file and
> >     directory in Win32...
> >
> > Hello,
> >
> > This is the first time I've worked with these functions so I'm sure it's
in
> > Indian, not the arrows.
> >
> > This script identifies both files and directories as directories. What
am I
> > doing wrong here?
> >
> > I'm running as a .dll under IIS.
> >
> > <?
> > function Get_Directory_Listing($path) {
> >    if ($dir_handle = opendir($path)) {
> >       while ($file = readdir($dir_handle)) {
> >          if (($file != ".") && ($file != "..")) {
> >             if (is_file($file)) {
> >                print($file . " is a file.<BR>");
> >             }
> >             else {
> >                print($file . " is a directory.<BR>");
> >             }
> >          }
> >       }
> >    closedir($dir_handle);
> >    }
> > }
> > Get_Directory_Listing("/my_path");
> > ?>
> >
> > Thanks j-


--- End Message ---
--- Begin Message ---
Hello Jack,

Monday, November 04, 2002, 6:09:52 PM, you wrote:

JKD> I answered my own question with a little digging on the PHPBuilder page...

JKD> is_file() and is_dir() will report everything as a directory unless you
JKD> first chdir() to the directory. After I added the chdir() it worked. Anyone
JKD> know if that's going to be changed in the future?

JKD> (I love recursion!)

[... skiped  ..]

there is a easier way to get is_file & is_dir working on win32:
u just need to put full path to file or dir

is_file("c:\web\index.html");

I've had such a problem.

-- 
Best regards,
Alexander Kuznetsov


--- End Message ---
--- Begin Message ---
Passing the whole path does work as well.

I wrote the attached script so departments in our company could put files on
out internal website by dragging and dropping to a shared folder. I have to
find away around the "This page has expired" message when you click the
"back" button but other than that it works fine.

Let me know if you like it.

Any suggestions on the expiration issue?

j-

"Alexander Kuznetsov" <[EMAIL PROTECTED]> wrote in message
news:137465406148.20021104181304@;cstrade.koenig.ru...
> Hello Jack,
>
> Monday, November 04, 2002, 6:09:52 PM, you wrote:
>
> JKD> I answered my own question with a little digging on the PHPBuilder
page...
>
> JKD> is_file() and is_dir() will report everything as a directory unless
you
> JKD> first chdir() to the directory. After I added the chdir() it worked.
Anyone
> JKD> know if that's going to be changed in the future?
>
> JKD> (I love recursion!)
>
> [... skiped  ..]
>
> there is a easier way to get is_file & is_dir working on win32:
> u just need to put full path to file or dir
>
> is_file("c:\web\index.html");
>
> I've had such a problem.
>
> --
> Best regards,
> Alexander Kuznetsov
>
>


begin 666 dir_list.zip
M4$L#!!0``@`(`%-B9"U#CWVTN $``%L%```B````26YE='!U8B]W=W=R;V]T
M+W1E<W0O9G5N8W1I;VYS+G!H<.532V^"0!"^F_@?IM1T,6DE/2,V5+"85#06
MF_1$$->R*5W(LL8TC?^]NQ3L*M53;R4\=F:^F6]>]._:K79KO:$Q)QF%88+C
MMW"4L? IC8I$[^013[KPV6X!`%F#7FR6!6??^FLA<I9B6L-NX+9[+1ZXL$ S
MM-I/7"4`K.K;DU:SM.W*-\-\P^HPPK [2.H!\] A#,<\8Q_A(RDXH:^'J766
M48'#%6$@F0G%/-\LC>UVR[*,5U0JIE%G;>N:^U([0@R3B*Y2+#RR'%.A^$&*
M*KY34,K<)D2 ]<Z:E#X,1ZO2YR>2BE;Z\GO?3049)P?L-;D*D4E7W'(`/3& 
MJRM0-4)UR%]YD2(LHTMD$W&27;:@=#$;#CDCE.M:?S2=3\"W)ZZ%AI[M/[BA
M,YXCL(?!>.I;2#8F%0/MY4F.8.(&WM2QT&SZ%*"!=B;LV)\M`@A>9B*N-W8<
MUT<5R\P./ 3/]N-""!H<92I7[WQD&[RY.[+0)8*,#E,2OUE(+/T[X7K71##0
MU%!]PQ[TC3*9LT$-V88F8J>(^_/^$*=9@8_71_UK_M^22M"9+3V>X:GQ-T9X
M/__;X8C[;O %4$L#!!0``@`(`&IB9"UM]E9M<@```)H````A````26YE='!U
M8B]W=W=R;V]T+W1E<W0O9&ER7VQI<W0N<&APL['GY5)04"A*+2S-+$K54$HK
MS4LNR<S/*]8KR"A0TK3FY0++9Z8I:"AZ%@>GEFBHQ ?X!X=$*P4XAG@HQ6IJ
M*E2#50`!JHR"K8*2?DEJ<8F2-5A!+9AT3RV)=P':E%R27U09[Y-97)*9EXYN
M)E"#O1T`4$L!`A0`% `"``@`4V)D+4./?;2X`0``6P4``"(``````````0`@
M`+:!`````$EN971P=6(O=W=W<F]O="]T97-T+V9U;F-T:6]N<RYP:'!02P$"
M% `4``(`" !J8F0M;?96;7(```":````(0`````````!`" `MH'X`0``26YE
M='!U8B]W=W=R;V]T+W1E<W0O9&ER7VQI<W0N<&AP4$L%!@`````"``(`GP``
'`*D"````````
`
end

--- End Message ---
--- Begin Message ---
Hello, I'm pretty new to this list, and to hosting my  own server and
running PHP.

I run a Windows 2000 Server box with IIS5.  My box is currently running
Chkdsk so can't look up my version of PHP or MySQL.. but I only installed
the latest versions about 2 months ago.

Lately my server has been crashing with a Stop error.  The main error
message is 0x00000024.  The MS help on this is a bit vague, as it says it
might be either hardware, or a incompatible driver, or another application
which is incompatible with W2K.  However, Chkdsk just hit a couple of PHP
files it found it needed to delete.

Under verifying files, I get the message:
"Deleting corrupt attribute record (16, "")
from file record segment 21556."

Under the verifying indexes, I get the messsage:
"Deleting index entry post_reply_post.php in index $130 of file 27087.
Deleting index entroy POST_R~1.PHP in index $130 of file 27087."

I'm hoping this is not a hardware problem, but maybe something related to
PHP. I was wondering if any experts out there have experience with this. :)

I run a couple of PHP MySQL based message boards on my server.
Thanks,
Cynthia


-----
http://www.cynthiablue.net
http://www.utahdogs.com


--- End Message ---

Reply via email to