php-windows Digest 13 Nov 2001 15:26:22 -0000 Issue 852
Topics (messages 10369 through 10382):
Re: PHP4 and IIS 5.1 Issues...
10369 by: AS
Re: Include files seem sqiffy
10370 by: Jason Bourne
Re: $PHP_AUTH_USER
10371 by: morten
10382 by: Ross Fleming
Re: PHP 4.0.6 + Apache 1.3.22 + WinNT 4
10372 by: Ermanno Iannacci
php_mcrypt.dll
10373 by: Paul - Zenith Tech Inc
10378 by: Daniel Beulshausen
Beta testers wanted for new product
10374 by: Peter Jukel
Re: php on W2K server
10375 by: Pojapoeg
10376 by: Pojapoeg
10377 by: Pojapoeg
Re: Seeing <BR><BR> in input box
10379 by: anch.org
Re: MING
10380 by: anch.org
10381 by: Daniel Beulshausen
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 ---
Thank you very much!
I think I'll switch to CGI... I don't like it very much tho... :(
Oh well... I suppose it's the price to pay for having a M$ server >:(
"Phil Driscoll" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I think you are just suffering from the usual php isapi module
instability.
> Either switch to using php as a cgi or, if you must use php as a module,
> change from IIS to apache.
>
> Cheers
> --
> Phil Driscoll
--- End Message ---
--- Begin Message ---
if you have installed php on windows i have to disapoint you: remote include
files do not work on windows.
<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am trying to install a php/mysql board but get warnings about
> Undefined variable: .
> It appears to be linked to the use of include files. Are these somewhat
> different under Doze? I'm a bit of a newbie with php but it does appear
> some php code needs tweaking to work in windows.
> Any pointers greatfully accepted!
>
--- End Message ---
--- Begin Message ---
Hi again,
Cool, where do you find out those things. (emty instead of !isset). Is it
possible at php.net?
Meantime I also find som exsamples at webmonkey.org. They turn out to
be good. And they - use 'isset'
<?php
// File Name: auth03.php
// Check to see if $PHP_AUTH_USER already contains info
if (!isset($PHP_AUTH_USER)) {
// If empty, send header causing dialog box to appear
header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
exit;
} else if (isset($PHP_AUTH_USER)) {
// If non-empty, open file containing valid user info
$filename = "text.txt";
$fp = fopen($filename, "r");
$file_contents = fread($fp, filesize($filename));
fclose($fp);
// Place each line in user info file into an array
$line = explode("\n", $file_contents);
// For as long as $i is <= the size of the $line array,
// explode each array element into a username and password pair
$i = 0;
while($i <= sizeof($line)) {
$data_pair = explode(":", $line[$i]);
if (($data_pair[0] == "$PHP_AUTH_USER") && ($data_pair[1] ==
"$PHP_AUTH_PW")) {
$auth = 1;
break;
} else {
$auth = 0;
}
$i++;
}
if ($auth == "1") {
echo "<P>You're authorized!</p>";
exit;
} else {
header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
}
}
?>
Morten
"Ross Fleming" <[EMAIL PROTECTED]> skrev i en meddelelse
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> <?php
> if (empty($PHP_AUTH_USER) || empty($PHP_AUTH_PW)) {
> header( 'WWW-Authenticate: Basic realm="Private"' );
> header( 'HTTP/1.0 401 Unauthorized' );
> echo 'Authorization Required.';
> exit;
> } else {
> echo "You entered $PHP_AUTH_USER for a username.<BR>";
> echo "You entered $PHP_AUTH_PW for a password.<BR>";
> }
> ?>
>
> -----Original Message-----
> From: morten [mailto:[EMAIL PROTECTED]]
> Sent: 12 November 2001 17:13
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] $PHP_AUTH_USER
>
>
> Hi,
>
> Yes the first one worked, but now I'm having trouble withe this one.
> How come? All these headers and $ have been a bit buggy...
>
> <?php
> if ((!isset( $PHP_AUTH_USER )) || (!isset($PHP_AUTH_PW))) {
> header( 'WWW-Authenticate: Basic realm="Private"' );
> header( 'HTTP/1.0 401 Unauthorized' );
> echo 'Authorization Required.';
> exit;
> } else {
> echo "You entered $PHP_AUTH_USER for a username.<BR>";
> echo "You entered $PHP_AUTH_PW for a password.<BR>";
> }
> ?>
>
> Morten
>
> "Morten" <[EMAIL PROTECTED]> skrev i en meddelelse
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi Ross,
> >
> > Thanks a LOT. It worked when I shifted to the LoadModule script.
> >
> > In all the danish sites where they wrote about php/apache they use the
old
> > script. How come if it is not working with headers?
> >
> > Morten
> >
> > "Ross Fleming" <[EMAIL PROTECTED]> skrev i en meddelelse
> > news:[EMAIL PROTECTED]...
> > > You haven't installed it as an apache module. I double checked. To
see
> > if
> > > I'm right, just create a php script with this in it:
> > > <?
> > > getallheaders();
> > > ?>
> > >
> > > If it says "call to undefined function" when u view it in explorer
then
> do
> > > the following.
> > >
> > > Copy php4ts.dll to windows/system or winnt/system32 or whatever one is
> > > applicable.
> > >
> > > Edit your httpd.conf and delete:
> > > ScriptAlias /php/ "c:/php/"
> > > AddType application/x-httpd-php .php
> > > Action application/x-httpd-php "/php/php.exe"
> > > wherever it might be and type this in its place:
> > >
> > > LoadModule php4_module c:/php/sapi/php4apache.dll
> > > AddType application/x-httpd-php .php
> > >
> > > making sure of course, that c:/php is where you've got php installed.
> > >
> > > Restart apache and hey presto..
> > >
> > > Ross
> > >
> > > -----Original Message-----
> > > From: Ross Fleming [mailto:[EMAIL PROTECTED]]
> > > Sent: 11 November 2001 22:14
> > > To: Morten [Achtung]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: RE: [PHP-WIN] $PHP_AUTH_USER
> > >
> > >
> > > OK, having run the same script, I'm getting a 500 as well, still not
> sure
> > > why, but I know the cause. Take out
> > > header("HTTP/1.0 401 Unauthorized");
> > > and it works. I really don't know why this doesn't work though, so
> > anyone,
> > > know why
> > >
> > > header("HTTP/1.0 401 Unauthorised"); causes an internal server
error?..
> > >
> > >
> > > Ross
> > >
> > > -----Original Message-----
> > > From: Morten [Achtung] [mailto:[EMAIL PROTECTED]]
> > > Sent: 11 November 2001 17:35
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: SV: [PHP-WIN] $PHP_AUTH_USER
> > >
> > >
> > > I am not running it as a CGI script.
> > > It's install on my computer together with Apache.
> > >
> > > I tried several script's but the don't work. Do I have to work
> > > with the php.ini file or?
> > >
> > > Morten
> > >
> > > -----Oprindelig meddelelse-----
> > > Fra: Ross Fleming [mailto:[EMAIL PROTECTED]]
> > > Sendt: 11. november 2001 17:24
> > > Til: morten; [EMAIL PROTECTED]
> > > Emne: RE: [PHP-WIN] $PHP_AUTH_USER
> > >
> > >
> > > How are you using PHP with the webserver? If you're running it as a
CGI
> > > script then you can't access those variables
> > >
> > > Ross
> > >
> > > -----Original Message-----
> > > From: morten [mailto:[EMAIL PROTECTED]]
> > > Sent: 11 November 2001 14:55
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP-WIN] $PHP_AUTH_USER
> > >
> > >
> > > Hi,
> > >
> > > I am trying to find out how to use $PHP_AUTH_USER. The problem is
> > > that I don't progress because of an 'Internal Server Error'. I tried
> > > this
> > > script
> > > from php.net:
> > >
> > > <?php
> > > if(!isset($PHP_AUTH_USER)) {
> > > header("WWW-Authenticate: Basic realm=\"My Realm\"");
> > > header("HTTP/1.0 401 Unauthorized");
> > > echo "Text to send if user hits Cancel button\n";
> > > exit;
> > > } else {
> > > echo "<p>Hello $PHP_AUTH_USER.</p>";
> > > echo "<p>You entered $PHP_AUTH_PW as your password.</p>";
> > > }
> > > ?>
> > >
> > > But the only answer is this: Internal Server Error. Is it the php.ini
> > > file
> > > that's not
> > > configured well, or..?
> > >
> > > Morten
> > >
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
--- End Message ---
--- Begin Message ---
Well it seemed to me that the $PHP_ variables were always set, just
sometimes blank. Yes it's possible at php.net, it's where I got most of
the answer for. I just used a bit of logic and searched for "empty" in
the function list, and it came up with that function. The best way to
do it, I would say, is to download the pdf version of the manual (quite
a hefty download, but worth it) and search it for terms you think will
help u. (ie searching for empty cos I knew I was looking for a function
that would tell me if a variable was empty or not)
As to your script, it looks to me as if that will allow you to have a
blank password, haven't tried it yet though, just at a first glance
that's my opinion. I'd also use a database lookup instead of a text
file to hold the usernames and passwords. a) more secure and b) easier
to control users.
Ross
morten wrote:
>
> Hi again,
>
> Cool, where do you find out those things. (emty instead of !isset). Is it
> possible at php.net?
> Meantime I also find som exsamples at webmonkey.org. They turn out to
> be good. And they - use 'isset'
>
> <?php
> // File Name: auth03.php
> // Check to see if $PHP_AUTH_USER already contains info
> if (!isset($PHP_AUTH_USER)) {
> // If empty, send header causing dialog box to appear
> header('WWW-Authenticate: Basic realm="My Private Stuff"');
> header('HTTP/1.0 401 Unauthorized');
> exit;
> } else if (isset($PHP_AUTH_USER)) {
> // If non-empty, open file containing valid user info
> $filename = "text.txt";
> $fp = fopen($filename, "r");
> $file_contents = fread($fp, filesize($filename));
> fclose($fp);
> // Place each line in user info file into an array
> $line = explode("\n", $file_contents);
> // For as long as $i is <= the size of the $line array,
> // explode each array element into a username and password pair
> $i = 0;
> while($i <= sizeof($line)) {
> $data_pair = explode(":", $line[$i]);
> if (($data_pair[0] == "$PHP_AUTH_USER") && ($data_pair[1] ==
> "$PHP_AUTH_PW")) {
> $auth = 1;
> break;
> } else {
> $auth = 0;
> }
> $i++;
> }
> if ($auth == "1") {
> echo "<P>You're authorized!</p>";
> exit;
> } else {
> header('WWW-Authenticate: Basic realm="My Private Stuff"');
> header('HTTP/1.0 401 Unauthorized');
> echo 'Authorization Required.';
> exit;
> }
> }
> ?>
>
> Morten
--- End Message ---
--- Begin Message ---
I did this, but do I have to load some .c file?
----- Original Message -----
From: "Ross Fleming" <[EMAIL PROTECTED]>
To: "Ouster" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, November 12, 2001 11:40 PM
Subject: RE: [PHP-WIN] PHP 4.0.6 + Apache 1.3.22 + WinNT 4
> LoadModule php4_module c:/php/sapi/php4apache.dll
> AddType application/x-httpd-php .php
>
> not php4.
>
> -----Original Message-----
> From: Ouster [mailto:[EMAIL PROTECTED]]
> Sent: 12 November 2001 21:49
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP-WIN] PHP 4.0.6 + Apache 1.3.22 + WinNT 4
>
>
> Do I need all the lines that load .c files?
> Is it not enough to load only .so files?
> I receive an error, after I wrote LoadModule php4, because there is a
> ClearModuleList instruction that (I think) removes what I loaded.
>
> Thanks
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
Anybody got a copy of this for any version of PHP > 4???
Is there nobody out there who could compile it?
PHP is open source, so is libmcrypt. If I knew how to, I would do it myself
but I don't!!
Thanks,
Paul
--- End Message ---
--- Begin Message ---
At 11:33 13.11.2001 +0000, Paul - Zenith Tech Inc wrote:
>Anybody got a copy of this for any version of PHP > 4???
>
>Is there nobody out there who could compile it?
>
>PHP is open source, so is libmcrypt. If I knew how to, I would do it myself
>but I don't!!
you'll have to port libmcrypt to windows first (without cygwin), as
libmcrypt is a fairly large codebase i doubt anybody has done that yet.
additionally from my knowledge the author has no big interest in an win32 port.
daniel
/*--
Daniel Beulshausen - [EMAIL PROTECTED]
Using PHP on Windows? http://www.php4win.com
--- End Message ---
--- Begin Message ---
Hi
We are looking for beta testers of our soon-to-be released program,
"Serlient" that allows for client-side execution of PHP without a separate
web-server. This essentially allows all PHP developers to develop software
for Windows.
You can download the first release candidate from our website at
http://www.triplehash.com. The Professional Edition is the one with PHP
support.
You can send bug reports to us through the "Contact Us" section of our
website.
Hope to see you there!
Regards
Peter
P.S. I hope you don't consider this as SPAM. I don't know where else to find
beta testers. The product is not yet available for sale, so it's not blatant
advertising.
--- End Message ---
--- Begin Message ---
And only 10 connection at same time
Pojapoeg
"Frank M. Kromann" wrote:
> Hi,
>
> IIS is the same on Windows 2000 server and Pro. The only difference is on the Pro
>version you can only have one web site.
>
> I use PHP on both types (doing only manual install though).
>
> - Frank
>
> > Can you install PHP on W2K server running IIS?
> >
> > I tried, it looked like it all worked until the end of the install. I got a
> > message saying that it was unable to configure IIS and that it needed to be
> > done manualy per the install.txt file. I looked in the install.txt file and
> > see no refrence to W2K server only W2K pro.
> >
> > Thanks
> > Austin
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
--- End Message ---
--- Begin Message ---
Hellou!
And 10 connections at same time.
Pojapoeg
"Frank M. Kromann" wrote:
> Hi,
>
> IIS is the same on Windows 2000 server and Pro. The only difference is on the Pro
>version you can only have one web site.
>
> I use PHP on both types (doing only manual install though).
>
> - Frank
>
> > Can you install PHP on W2K server running IIS?
> >
> > I tried, it looked like it all worked until the end of the install. I got a
> > message saying that it was unable to configure IIS and that it needed to be
> > done manualy per the install.txt file. I looked in the install.txt file and
> > see no refrence to W2K server only W2K pro.
> >
> > Thanks
> > Austin
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
--- End Message ---
--- Begin Message ---
And 10 connections at same time.
Pojapoeg
"Frank M. Kromann" wrote:
> Hi,
>
> IIS is the same on Windows 2000 server and Pro. The only difference is on the Pro
>version you can only have one web site.
>
> I use PHP on both types (doing only manual install though).
>
> - Frank
>
> > Can you install PHP on W2K server running IIS?
> >
> > I tried, it looked like it all worked until the end of the install. I got a
> > message saying that it was unable to configure IIS and that it needed to be
> > done manualy per the install.txt file. I looked in the install.txt file and
> > see no refrence to W2K server only W2K pro.
> >
> > Thanks
> > Austin
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
--- End Message ---
--- Begin Message ---
Looks like something in your script is converting to HTML. Line breaks are
converted to <BR> for display as HTML. To re-enter into a text box you'll
have to convert the <BR> back into crLF.
"Jack" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Dear all
> I had made a page for edit which contains Input box, but the Input box is
> not blank, i had used the php script to make the input box use the last
> input text as the default value.
> The problem comes out like this, when i input the text into the input box
on
> the first time, it just works fine (it copy my heading to a file called
> "Heading.txt" and the content to a file called "Content.txt", then when i
> click a link , the heading and the context from these file will be display
> nicely.), but when i go back to the page for edit on sec time, i can see
> there is a lot of <BR> in the input box, as much time i submit to the
input
> box, the more <BR> will come out and display in the box.
> So is there anyway that i can skip the <BR> appear in my input box???
> The input box is actually read the content from the heading and
content.txt
> file.
>
> Thx
> Jack
> [EMAIL PROTECTED]
>
>
--- End Message ---
--- Begin Message ---
I think you need to enter a mapping in php.ini to use extensions like ming
or whatever.
"Josh Seward" <[EMAIL PROTECTED]> wrote in message
000f01c16b4f$9c8a6af0$9300a8c0@wisestructures">news:000f01c16b4f$9c8a6af0$9300a8c0@wisestructures...
I am getting the following error:
Warning: Unable to load dynamic library 'C:\extentions\php_ming.dll' - The
specified module could not be found. in
c:\inetpub\wwwroot\dawndusk\swf_test\swf_shape.php on line 2
If I have the php_ming.dll in the extensions folder. Why do I still get this
error? Any info. helps.
I am also looking for docs on ming windows 2000 install!
Thanks,
Josh Seward
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
At 04:26 13.11.2001 -0900, anch.org wrote:
>I think you need to enter a mapping in php.ini to use extensions like ming
>or whatever.
>
>"Josh Seward" <[EMAIL PROTECTED]> wrote in message
>000f01c16b4f$9c8a6af0$9300a8c0@wisestructures">news:000f01c16b4f$9c8a6af0$9300a8c0@wisestructures...
>I am getting the following error:
>
>Warning: Unable to load dynamic library 'C:\extentions\php_ming.dll' - The
>specified module could not be found. in
>c:\inetpub\wwwroot\dawndusk\swf_test\swf_shape.php on line 2
>
>
>If I have the php_ming.dll in the extensions folder. Why do I still get this
>error? Any info. helps.
probably a dependency problem, check with http://www.dependencywalker.com
daniel
/*--
Daniel Beulshausen - [EMAIL PROTECTED]
Using PHP on Windows? http://www.php4win.com
--- End Message ---