php-windows Digest 6 Dec 2002 23:20:36 -0000 Issue 1474

Topics (messages 17312 through 17336):

Re: hello there.
        17312 by: Stephen Edmonds
        17313 by: Rico Derks

Could not open fdf document
        17314 by: Ad Brouwer
        17321 by: Christoph Grottolo

Re: mystery line
        17315 by: Svensson, B.A.T. (HKG)
        17316 by: Stephen Edmonds

PHP Admin for Active Dir
        17317 by: Brennan Mann

Includes not working on W2K
        17318 by: Ed Turbin
        17319 by: Luis Ferro
        17323 by: Frank M. Kromann
        17328 by: Ed Turbin
        17329 by: DL Neil
        17331 by: Ed Turbin
        17333 by: DL Neil

DOCUMENT_ROOT on Apache
        17320 by: Radovan Radic
        17324 by: erythros
        17325 by: Radovan Radic
        17332 by: erythros

CGI or EXEC
        17322 by: Brennan Mann

Re: [PHP] mail() problems...
        17326 by: DL Neil
        17327 by: Anthony Ritter
        17330 by: DL Neil
        17334 by: Anthony Ritter
        17335 by: DL Neil
        17336 by: Anthony Ritter

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 ---
It's called 'Register Globals'

Basically, rather than having $DOCUMENT_ROOT, all the preset variables are
stored in 'Super arrays'. This means you will now have to use
$_SERVER["DOCUMENT_ROOT"]

For more information:
http://www.php.net/manual/en/security.registerglobals.php

Use
phpinfo(32);
to list all variables in a script, quite a good debug tool

Stephen

----- Original Message -----
From: "christopher calicott" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 06, 2002 3:02 AM
Subject: [PHP-WIN] hello there.


> I have a script in a website that I was working on about a year ago.. it
was
> working when I left off.  I had a hard drive crash and then subsequently
got
> REALLY sidetracked and I am just getting back around to finishing the
design
> of the site and adding new content so I can publish it.
>
> The thing is, when I reinstalled the latest Apache and PHP the other
day...
> the script is suddenly not working.  Apparently something has changed
> between the older and the newer versions that's killed the script.
>
> It is a really simple one.  It looks in a directory where there are images
> all of the same size, grabs one at random and sticks it in a table in my
> html document.  this just gives the appearance of a little dynamics to the
> website. Like I said, it was working great before, but now - nada.
>
> (btw I am on Windows 2000 here)
>
> here are the errors I am getting:
>
> Warning: OpenDir: Invalid argument (errno 22) in
> c:\wwwroot\includes\menu_bar.php on line 5
>
> Fatal error: Call to a member function on a non-object in
> c:\wwwroot\includes\menu_bar.php on line 6
>
>
> below is the script and the image line that places the image in the
> document:
>
> <?
>
>   $strRealPath = "$DOCUMENT_ROOT/images/random_gen/";
> //$DOCUMENT_ROOT.dirname($SCRIPT_NAME)."/";
>
>   $handle = dir($strRealPath);
>   while ($strFilename = $handle->read()) {
>         if ( ($strFilename != ".") && ($strFilename != "..") ) {
>                 $aryFileNames[] = $strFilename;
>         }
>   }
>
>   $strPicFile = $aryFileNames[Rand(0,count($aryFileNames)-1)];
>
> ?>
>
> <IMG SRC="/images/random_gen/<?=$strPicFile?>" BORDER=0 alt=""><br>
>
>
>
> Does anyone have any ideas what might be the problem?
>
> -=- christopher
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

In the newer versions of PHP. Register_globals is switched off. You can switch it on again in PHP.INI. If I'am correct, they switched it off due to security reasons. Depending how important that is for you, you can switch it on.

Greetings, RICO.

At 09:02 PM 12/5/2002 -0600, christopher calicott wrote:
I have a script in a website that I was working on about a year ago.. it was
working when I left off.  I had a hard drive crash and then subsequently got
REALLY sidetracked and I am just getting back around to finishing the design
of the site and adding new content so I can publish it.

The thing is, when I reinstalled the latest Apache and PHP the other day...
the script is suddenly not working.  Apparently something has changed
between the older and the newer versions that's killed the script.

It is a really simple one.  It looks in a directory where there are images
all of the same size, grabs one at random and sticks it in a table in my
html document.  this just gives the appearance of a little dynamics to the
website. Like I said, it was working great before, but now - nada.

(btw I am on Windows 2000 here)

here are the errors I am getting:

Warning: OpenDir: Invalid argument (errno 22) in
c:\wwwroot\includes\menu_bar.php on line 5

Fatal error: Call to a member function on a non-object in
c:\wwwroot\includes\menu_bar.php on line 6


below is the script and the image line that places the image in the
document:

<?

  $strRealPath = "$DOCUMENT_ROOT/images/random_gen/";
//$DOCUMENT_ROOT.dirname($SCRIPT_NAME)."/";

  $handle = dir($strRealPath);
  while ($strFilename = $handle->read()) {
        if ( ($strFilename != ".") && ($strFilename != "..") ) {
                $aryFileNames[] = $strFilename;
        }
  }

  $strPicFile = $aryFileNames[Rand(0,count($aryFileNames)-1)];

?>

<IMG SRC="/images/random_gen/<?=$strPicFile?>" BORDER=0 alt=""><br>



Does anyone have any ideas what might be the problem?

-=- christopher


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

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

When submitting a form to my php-script, I get the error:
Could not open fdf document: test.fdf

this is my script:
<?php
 $fdffp = fopen("test.fdf", "w");
 fwrite($fdffp, $HTTP_FDF_DATA, strlen($HTTP_FDF_DATA));
 fclose($fdffp);

 $fdf = fdf_open("test.fdf");
 $txtNaam = fdf_get_value($fdf, "txtNaam");
 echo "Het txtNaam veld heeft de waarde '<B>$txtNaam</B>'<BR>";
 fdf_close($fdf);
?>

The file test.fdf is created correctly (first three code-lines).

Running php 4.2.2 on W2K and IIS

Any suggestions?

Ad Brouwer


--- End Message ---
--- Begin Message ---
Ad Brouwer wrote:
> Hi all,
>
> When submitting a form to my php-script, I get the error:
> Could not open fdf document: test.fdf
>
> this is my script:
> <?php
>  $fdffp = fopen("test.fdf", "w");
>  fwrite($fdffp, $HTTP_FDF_DATA, strlen($HTTP_FDF_DATA));
>  fclose($fdffp);
>
>  $fdf = fdf_open("test.fdf");
>  $txtNaam = fdf_get_value($fdf, "txtNaam");
>  echo "Het txtNaam veld heeft de waarde '<B>$txtNaam</B>'<BR>";
>  fdf_close($fdf);
>>
>
> The file test.fdf is created correctly (first three code-lines).

Have a look at
http://bugs.php.net/?id=14877

Christoph



--- End Message ---
--- Begin Message ---
> God bless us everyone.

Will that make our programs free of bugs?
--- End Message ---
--- Begin Message ---
Only if you circle your computer 3 times and tap your heels together. Or was
that tap your heels together 3 times, then circle your computer?

One of the two...

----- Original Message -----
From: "Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "PHP Windows Help List"
<[EMAIL PROTECTED]>
Sent: Friday, December 06, 2002 2:00 PM
Subject: RE: [PHP-WIN] mystery line


> > God bless us everyone.
>
> Will that make our programs free of bugs?
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
Hello Everybody,

    Does PHP have to capabilities to interact with windows 2000 server
active directory to manage users, see which users are logged on. Stuff that
you would be able to do from the console of the sever. If so, do you know
where I could find a doc on this.

Thanks,
Brennan


--- End Message ---
--- Begin Message ---
I've just installed PHP on Windows 2000 and I'm not able to use includes.
I'm able to get the PHP info screen as a test, so I know it is working. I
edited the PHP.ini file to the directory where my include files are located
and still no luck. Is there anything that I am overlooking, or anything else
that I need to do to get includes working?


--- End Message ---
--- Begin Message --- In php.ini file that is present in the windows directory check the include_path directive. It should have something like:

include_path = ".;c:\apps\php\pear"

Also, when making includes, check for the escaped "\". If they are present but not escaped, the directory that php will try to find will be completelly diferent...

Cheers...
Luis Ferro
TelaDigital.Net

Ed Turbin wrote:

I've just installed PHP on Windows 2000 and I'm not able to use includes.
I'm able to get the PHP info screen as a test, so I know it is working. I
edited the PHP.ini file to the directory where my include files are located
and still no luck. Is there anything that I am overlooking, or anything else
that I need to do to get includes working?





---
[This E-mail scanned for viruses by Declude Virus]

--- End Message ---
--- Begin Message ---
On Windows 200 and XP you can use / as your seperator. This will not work
on WIndows 98 though.

Using the / makes your code work on both W2k and *nix boxes. It can be
used both in php.ini and in your scripts.

- Frank

> In php.ini file that is present in the windows directory check the 
> include_path directive. It should have something like:
> 
> include_path = ".;c:\apps\php\pear"
> 
> Also, when making includes, check for the escaped "\". If they are 
> present but not escaped, the directory that php will try to find will be

> completelly diferent...
> 
> Cheers...
> Luis Ferro
> TelaDigital.Net
> 
> Ed Turbin wrote:
> 
> >I've just installed PHP on Windows 2000 and I'm not able to use
includes.
> >I'm able to get the PHP info screen as a test, so I know it is working.
I
> >edited the PHP.ini file to the directory where my include files are
located
> >and still no luck. Is there anything that I am overlooking, or anything
else
> >that I need to do to get includes working?
> >
> >
> >
> >  
> >
> 
> 
> ---
> [This E-mail scanned for viruses by Declude Virus]
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



--- End Message ---
--- Begin Message ---
Still no luck with this. My include path in the php.ini is set to:
include_path = ".;\c:\php\includes" and I have the includes directory in the
above listed location. Any ideas?


"Frank M. Kromann" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Windows 200 and XP you can use / as your seperator. This will not work
> on WIndows 98 though.
>
> Using the / makes your code work on both W2k and *nix boxes. It can be
> used both in php.ini and in your scripts.
>
> - Frank
>
> > In php.ini file that is present in the windows directory check the
> > include_path directive. It should have something like:
> >
> > include_path = ".;c:\apps\php\pear"
> >
> > Also, when making includes, check for the escaped "\". If they are
> > present but not escaped, the directory that php will try to find will be
>
> > completelly diferent...
> >
> > Cheers...
> > Luis Ferro
> > TelaDigital.Net
> >
> > Ed Turbin wrote:
> >
> > >I've just installed PHP on Windows 2000 and I'm not able to use
> includes.
> > >I'm able to get the PHP info screen as a test, so I know it is working.
> I
> > >edited the PHP.ini file to the directory where my include files are
> located
> > >and still no luck. Is there anything that I am overlooking, or anything
> else
> > >that I need to do to get includes working?
> > >
> > >
> > >
> > >
> > >
> >
> >
> > ---
> > [This E-mail scanned for viruses by Declude Virus]
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>


--- End Message ---
--- Begin Message ---
Ed,

> Still no luck with this. My include path in the php.ini is set to:
> include_path = ".;\c:\php\includes" and I have the includes directory in
the
> above listed location. Any ideas?

you don't want the first \ - before the c:\etc path

Regards,
=dn

--- End Message ---
--- Begin Message ---
Dl, I tried that and it's still not happening. What else could you
reccommend checking? Is there any way that I can take the guess work out of
this?


"Dl Neil" <[EMAIL PROTECTED]> wrote in message
0e4001c29d66$56672320$c900a8c0@jrbrown">news:0e4001c29d66$56672320$c900a8c0@jrbrown...
> Ed,
>
> > Still no luck with this. My include path in the php.ini is set to:
> > include_path = ".;\c:\php\includes" and I have the includes directory in
> the
> > above listed location. Any ideas?
>
> you don't want the first \ - before the c:\etc path
>
> Regards,
> =dn
>


--- End Message ---
--- Begin Message ---
Ed,

> Dl, I tried that and it's still not happening. What else could you
> reccommend checking? Is there any way that I can take the guess work out
of
> this?


Here's what my dev system has:

include_path = ".;C:\Documents and Settings\Administrator\My
Documents\WebWork\Code\Includes"

Hope it helps,
=dn

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

I installed Apache 1.3.27 on w2k, after using IIS.
When i try to output
print "<A HREF=\"$DOCUMENT_ROOT\">Home</A>;
it gives me A HREF="c:/inetpub/wwwroot/test/"
instead of
http://localhost/test
Why is that?

Radovan


--- End Message ---
--- Begin Message ---
because your asking for the document root, ie: the directory root.

"Radovan Radic" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi
>
> I installed Apache 1.3.27 on w2k, after using IIS.
> When i try to output
> print "<A HREF=\"$DOCUMENT_ROOT\">Home</A>;
> it gives me A HREF="c:/inetpub/wwwroot/test/"
> instead of
> http://localhost/test
> Why is that?
>
> Radovan
>
>


--- End Message ---
--- Begin Message ---
Ok,
what should i do ot get
http://localhost/test
I need this do make a link to homepage (i got same app on more servers and i
dont want to hard-code in every page )

Radovan

"Erythros" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> because your asking for the document root, ie: the directory root.
>
> "Radovan Radic" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi
> >
> > I installed Apache 1.3.27 on w2k, after using IIS.
> > When i try to output
> > print "<A HREF=\"$DOCUMENT_ROOT\">Home</A>;
> > it gives me A HREF="c:/inetpub/wwwroot/test/"
> > instead of
> > http://localhost/test
> > Why is that?
> >
> > Radovan
> >
> >
>
>


--- End Message ---
--- Begin Message ---
<a href ="/test">home</a>
this will build it onto the pre-exsistin web address. so if your at
www.mypage.com and you click that link you'll go to www.mypage.com/test.

"Radovan Radic" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Ok,
> what should i do ot get
> http://localhost/test
> I need this do make a link to homepage (i got same app on more servers and
i
> dont want to hard-code in every page )
>
> Radovan
>
> "Erythros" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > because your asking for the document root, ie: the directory root.
> >
> > "Radovan Radic" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Hi
> > >
> > > I installed Apache 1.3.27 on w2k, after using IIS.
> > > When i try to output
> > > print "<A HREF=\"$DOCUMENT_ROOT\">Home</A>;
> > > it gives me A HREF="c:/inetpub/wwwroot/test/"
> > > instead of
> > > http://localhost/test
> > > Why is that?
> > >
> > > Radovan
> > >
> > >
> >
> >
>
>


--- End Message ---
--- Begin Message ---
Hello,
    I want to get some opinions on whether to use a CGI call from a web page
or using PHP to use exec(). Right now I am using a form/CGI to invoke the
program, but recently I discovered that PHP can exe program with parms.

1.) Which method would you use?

2.) Which is more secure?

3.) Anything other suggestions?

Thanks,
Brennan



--- End Message ---
--- Begin Message ---
Anthony,

> The PHP mail scripts were taken from Julie Meloni's book on PHP called
"Fast
> and East" on pp. 116-117. (PrimaTech).
> In fact, she writes:
> "If you're using PHP4 on Windows, look for the following lines in your
> php.ini file:
> 1. For the SMTP entry, use 'localhost" or the name of the outgoing
> mailserver you use in your e-mail client.
> 2. For the sendmail_from entry, enter your e-mail address.
> For example in my php.ini file on Windows contains this:
> [mail function]
> SMTP =    localhost
> sendmail_from = [EMAIL PROTECTED]
> END QUOTE
>
> So that's what I did -using localhost - and I get:
> "failed to connect".


Ok, and it didn't work, so have you tried the alternative Julie offers?

Please review our earlier posts: you can only use localhost if the local
machine is running an SMTP server - if it's not, you'll have to point PHP at
someone else's SMTP server.

All this allows you/PHP to use an SMTP server anywhere, but it MUST see an
SMTP server somewhere!

Regards,
=dn

--- End Message ---
--- Begin Message ---
DL,
I have quoted her exactly from her book where it says:

Windows Users:

**Check your php.ini File**

She then writes what I previously posted.
That's it.  She offers no alternatives.

Regards,
TR



---
[This E-mail scanned for viruses by gonefishingguideservice.com]

--- End Message ---
--- Begin Message ---
Anthony,

> I have quoted her exactly from her book where it says:
>
> Windows Users:
>
> **Check your php.ini File**
>
> She then writes what I previously posted.
> That's it.  She offers no alternatives.


Not true - you've bamboozled yourself somehow. You quoted Julie:
"1. For the SMTP entry, use 'localhost" or the name of the outgoing
mailserver you use in your e-mail client."

so you've tried localhost, and it didn't work. Let's move on to the "OR"
= the name of the outgoing mailserver you use in your e-mail client.

What happens then?
=dn

--- End Message ---
--- Begin Message ---
DL,
Sorry to be a pain... but using either:

the address of my outgoing mail server

or

localhost

still gives me:

Warning: Failed to Connect in c:\program files\apache
group\apache\htdocs\send_simpleform.php on line 19

Thanks again for your time.
TR




---
[This E-mail scanned for viruses by gonefishingguideservice.com]

--- End Message ---
--- Begin Message ---
> Sorry to be a pain... but using either:
> the address of my outgoing mail server
> or
> localhost
> still gives me:
> Warning: Failed to Connect in c:\program files\apache
> group\apache\htdocs\send_simpleform.php on line 19


Did you restart Apache after changing PHP.INI?

Please post the mail() section of the script and the mail section of the
PHP.INI.
=dn


--- End Message ---
--- Begin Message ---
O.K. DL...
Thanks for the reply.

And your time.  :-{}

Yes. I restarted Apache - it came up the same.

It would seem that Apache works along with php4 since I get the
enviromental variables, etc. page when

I go to:

http://localhost/phpinfo.php

which was saved as:

<?
phpinfo()
?>

This is exactly what the lines in the [mail function] within my php.ini file
looks like:

...................
[mail function]
SMTP   = localhost   ;for win32 only
sendmail_from = [EMAIL PROTECTED] ;for win32 only
;sendmail_path =      ;for unix only, may supply arguments as well (default
is sendmail -t)
....................

which is what she advises on page 116 of her book.

I have inserted:

localhost

and

my e-mail address

in the php.ini file.

And I took the script - html and php - right off her CD and tested them on
a Win98 / Apache / OE 5

and got:

............................
Warning: Failed to Connect in c:\program files\apache
group\apache\htdocs\send_simpleform.php on line 19


// This is my php.ini file in WINDOWS

[mail function]
SMTP   = localhost   ;for win32 only
sendmail_from = [EMAIL PROTECTED] ;for win32 only
;sendmail_path =      ;for unix only, may supply arguments as well (default
is sendmail -t)

....................................

//...and this is the html form:

<HTML>
<HEAD>
<TITLE>Simple Feedback Form</TITLE>
</HEAD>
<BODY>

<FORM METHOD="post" ACTION="send_simpleform.php">


<P><strong>Your Name:</strong><br>
<INPUT type="text" NAME="sender_name" SIZE=30></p>

<P><strong>Your E-Mail Address:</strong><br>
<INPUT type="text" NAME="sender_email" SIZE=30></p>

<P><strong>Message:</strong><br>
<TEXTAREA NAME="message" COLS=30 ROWS=5 WRAP=virtual></TEXTAREA></p>

<P><INPUT TYPE="submit" NAME="submit" VALUE="Send This Form"></p>

</FORM>

</BODY>
</HTML>

..............................



//and lastly... this is the php script:
<?
if (($sender_name == "") && ($sender_email == "") && ($message == "")) {
 header("Location: http://localhost/simple_form.html";);
 exit;
}
$msg = "E-MAIL SENT FROM WWW SITE\n";
$msg .= "Sender's Name:    $sender_name\n";
$msg .= "Sender's E-Mail:  $sender_email\n";
$msg .= "Message:          $message\n\n";
$to = "[EMAIL PROTECTED]";
$subject = "Web Site Feedback";
$mailheaders = "From: My Web Site <> \n";
$mailheaders .= "Reply-To: $sender_email\n\n";
mail($to, $subject, $msg, $mailheaders);
?>
<HTML>
<HEAD>
<TITLE>Simple Feedback Form Sent</TITLE>
</HEAD>
<BODY>
<H1>The following e-mail has been sent:</H1>
<P><strong>Your Name:</strong><br>
<? echo "$sender_name"; ?>
<P><strong>Your E-Mail Address:</strong><br>
<? echo "$sender_email"; ?>
<P><strong>Message:</strong><br>
<? echo "$message"; ?>
</BODY>
</HTML>
.....................................................


----- Original Message -----
From: "DL Neil" :

> Did you restart Apache after changing PHP.INI?
>
> Please post the mail() section of the script and the mail section of the
> PHP.INI.
> =dn


---
[This E-mail scanned for viruses by gonefishingguideservice.com]

--- End Message ---

Reply via email to