php-windows Digest 22 Feb 2002 14:49:43 -0000 Issue 1013
Topics (messages 12215 through 12223):
Re: PHP Authentication
12215 by: Gehring Uwe
12216 by: Rasmus Lerdorf
12217 by: Ross Fleming
12220 by: Collins, Robert
"The connection with the server was reset"
12218 by: Ronny Salomonsen
12219 by: Ross Fleming
Bad char Translation
12221 by: -HONU-
12223 by: Svensson, B.A.T. (HKG)
Re: Form
12222 by: Nicole Amashta
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 ---
I am running php/CGI with IIS on Win2k with Authentification - it is
working.
Uwe
-----Ursprüngliche Nachricht-----
Von: Christoph Grottolo [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 21. Februar 2002 20:30
An: [EMAIL PROTECTED]
Betreff: Re: [PHP-WIN] PHP Authentication
"Rasmus Lerdorf" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| HTTP Auth does not work with the CGI version of PHP which is what I
| presume you are using on Windows. Switch back to UNIX.
oh, please, dear sysadmin, set up a real good unix server for me -
that's
all you have to do?
rasmus - not everybody has full choice.
Christoph
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Well, then you simply can't use HTTP Authentication from PHP. The web
server doesn't expose the required information to the CGI environment. It
isn't PHP's fault.
-Rasmus
On Thu, 21 Feb 2002, Christoph Grottolo wrote:
>
> "Rasmus Lerdorf" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> | HTTP Auth does not work with the CGI version of PHP which is what I
> | presume you are using on Windows. Switch back to UNIX.
>
> oh, please, dear sysadmin, set up a real good unix server for me - that's
> all you have to do?
>
> rasmus - not everybody has full choice.
>
> Christoph
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
You could always just do the authentication simply from IIS
Ross
-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: 22 February 2002 07:55
To: Christoph Grottolo
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] PHP Authentication
Well, then you simply can't use HTTP Authentication from PHP. The web
server doesn't expose the required information to the CGI environment. It
isn't PHP's fault.
-Rasmus
On Thu, 21 Feb 2002, Christoph Grottolo wrote:
>
> "Rasmus Lerdorf" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> | HTTP Auth does not work with the CGI version of PHP which is what I
> | presume you are using on Windows. Switch back to UNIX.
>
> oh, please, dear sysadmin, set up a real good unix server for me - that's
> all you have to do?
>
> rasmus - not everybody has full choice.
>
> Christoph
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
It took some digging on the PHP-Win Archive but I found the answer a long
time ago... You have to be running PHP as an Apache module (not a CGI).
in Apache change :
ScriptAlias /php/ "C:/Program Files/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
to :
LoadModule php4_module "C:/PHP/sapi/php4apache.dll"
AddType application/x-httpd-php .php
then use something like:
<?php
if(!isset($PHP_AUTH_USER)) {
header("WWW-Authenticate: Basic realm='private'");
header("HTTP/1.0 401 Unauthorized");
echo "Authorization Required.";
exit;
}
?>
-----Original Message-----
From: Gehring Uwe [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 22, 2002 1:40 AM
To: [EMAIL PROTECTED]
Subject: AW: [PHP-WIN] PHP Authentication
I am running php/CGI with IIS on Win2k with Authentification - it is
working.
Uwe
-----Ursprüngliche Nachricht-----
Von: Christoph Grottolo [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 21. Februar 2002 20:30
An: [EMAIL PROTECTED]
Betreff: Re: [PHP-WIN] PHP Authentication
"Rasmus Lerdorf" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| HTTP Auth does not work with the CGI version of PHP which is what I
| presume you are using on Windows. Switch back to UNIX.
oh, please, dear sysadmin, set up a real good unix server for me -
that's
all you have to do?
rasmus - not everybody has full choice.
Christoph
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I've created a simple downloadscript that handles file downloads (it
redirects to a file that cannot be accessed through internet.
After 2% I get the following errormessage:
Internet Explorer cannot download basedata.mdb from [removed]
The connection with the server was reset
The script has downloaded 411 kb of 17.6 MB, and other people has a similar
problem. Sometimes it downloads about 5 MB and closes the downloading window
and says it has successfully downloaded the file.
What could be wrong?
I'm running PHP 4.1.1 on a MS IIS 5.0 server. The code is as follows:
<?php
set_time_limit(0);
error_reporting(E_ALL);
$get = "basedata.mdb";
// Handle download-requests
header("Content-Type: application/force-download\n");
header("Content-Disposition: attachment; filename=\"$get\"\n");
header("Content-Description: GAB database\n");
header("Content-Transfer-Encoding: binary\n");
header("Content-Length: " . filesize($get));
$fd=fopen($get,'r');
fpassthru($fd);
readfile($get);
exit;
?>
--- End Message ---
--- Begin Message ---
Hmmm... to me it sounds like it times-out. I know you've got
set_time_limit(0), but have you removed max_execution_time from the php.ini
file? I think that if it's there then it still gets used. Otherwise I'd
look into IIS's timeout settings (don't know about them) which might very
well override PHP's timeouts.
These are only hypotheses, but can you humour me and look into them?
I'm a bit confused as to why you're passing the file through twice though?
Also, are these files definately not binary? In which case the fopen
attribute is wrong.
Ross
-----Original Message-----
From: Ronny Salomonsen [mailto:[EMAIL PROTECTED]]
Sent: 20 January 2002 09:13
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] "The connection with the server was reset"
I've created a simple downloadscript that handles file downloads (it
redirects to a file that cannot be accessed through internet.
After 2% I get the following errormessage:
Internet Explorer cannot download basedata.mdb from [removed]
The connection with the server was reset
The script has downloaded 411 kb of 17.6 MB, and other people has a similar
problem. Sometimes it downloads about 5 MB and closes the downloading window
and says it has successfully downloaded the file.
What could be wrong?
I'm running PHP 4.1.1 on a MS IIS 5.0 server. The code is as follows:
<?php
set_time_limit(0);
error_reporting(E_ALL);
$get = "basedata.mdb";
// Handle download-requests
header("Content-Type: application/force-download\n");
header("Content-Disposition: attachment; filename=\"$get\"\n");
header("Content-Description: GAB database\n");
header("Content-Transfer-Encoding: binary\n");
header("Content-Length: " . filesize($get));
$fd=fopen($get,'r');
fpassthru($fd);
readfile($get);
exit;
?>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
I've got a text file containing "blés, Châteaux ..." (without quotes)
I'm reading this file like this
$FileName = "Test.txt";
$FileHand = fopen($FileName, "rb");
$Data = fread($FileHand, filesize($FileName));
fclose($FileHand);
print_r($Data);
Under Linux, by asking the script throught an HTTP server ... i've got the
good text
blés, Châteaux ...
But when i launch the script through the console (under windows 2000) ...
characters are translated :
blùs, Chôteaux ...
what does it means .. .?
--- End Message ---
--- Begin Message ---
>Hi,
>
>I've got a text file containing "blés, Châteaux ..." (without quotes)
[...]
>But when i launch the script through the console (under
>windows 2000) ...characters are translated :blùs, Chôteaux ...
>
>what does it means .. .?
Windows uses ISO-Latin-1, aka ISO-8859-1. So it probably means that the text
is written in another code page than ISO-Latin-1. You need either 1)
translate the page to ISO-Latin-1 or 2) tell in the webpage to use another
code page for the char set.
--- End Message ---
--- Begin Message ---
haha, sorry
i saw the bad words, and couldn't help myself ...
"Internerds Canada" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I need to make this script send a file with it, can anyone help? thanks.
> dont worry about the bottom part, i havent finished it
>
> <?PHP
>
> function convertGMT()
>
> $t = time();
> $gmtOffset = 2;
> $h = $gmtOffset * 3600;
> $t = $t - $h;
> $time_signed = date("F d, Y h:i a", $t);
> return $time_signed;
> }
>
> if (!isset($submit)){
> echo "<font face=\"Verdana\" size=\"2\"><strong>Submit
> Script</strong></font><p>";
> echo "<form action=\"$PHP_SELF\" method=\"post\">";
> echo "<p><table cellpadding=\"4\"><tr><td>";
> echo "<font face=\"Verdana\" size=\"2\">Name:</td><td> <input
type=\"text\"
> name=\"name\" size=\"25\" maxlength=\"50\"></td></tr>";
> echo "<tr><td><font face=\"Verdana\" size=\"2\">Email:</td><td> <input
> type=\"text\" name=\"email\" size=\"25\"></td></tr>";
> echo "<tr><td><font face=\"Verdana\" size=\"2\">Language:</td><td> <input
> type=\"text\" name=\"language\" size=\"25\"></td></tr>";
> echo "<tr><td><font face=\"Verdana\" size=\"2\">Subject:</td><td> <input
> type=\"text\" name=\"subject\" size=\"25\"></td></tr>";
> echo "<tr><td valign=\"top\"><font face=\"Verdana\"
> size=\"2\">Comments:</td><td> <textarea name=\"comments\" rows=\"12\"
> cols=\"40\"></textarea></td></tr>";
> echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\"
> name=\"submit\" value=\" Send Script \"></td></tr><tr><td><font size=\"1\"
> color=\"red\">IP: $REMOTE_ADDR</font></td></tr></table>";
>
> echo "</form>";
> }else{
> file://take out bad words
> $name = eregi_replace("(fuck|shit|bitch|dick|pussy|suck|mama|mofo|ass)",
> "####", $name);
> $suggestion =
> eregi_replace("(fuck|shit|bitch|dick|pussy|suck|mama|mofo|ass)", "####",
> $suggestion);
> $email = eregi_replace("(fuck|shit|bitch|dick|pussy|suck|mama|mofo|ass)",
> "####", $email);
> file://thank user
> $cleanname=HTMLSpecialChars($name);
> $clean_suggestion=HTMLSpecialChars($suggestion);
> $clean_email=HTMLSpecialChars($email);
>
> if (!preg_match("/^[\.A-Za-z0-9_-]+@[\.A-Za-z0-9_-]+\.[A-Za-z]{2,6}$/",
> $email)) {
> echo "<font face=\"Verdana\" size=\"2\">Email was invalid. Please resend
> your suggestion.<br>";
> echo "<font face=\"Verdana\" size=\"2\"><strong>Suggestion
> Form</strong></font><p>";
> echo "<form action=\"$PHP_SELF\" method=\"post\">";
> echo "<p><table cellpadding=\"4\"><tr><td>";
> echo "<font face=\"Verdana\" size=\"2\">Name:</td><td> <input
type=\"text\"
> name=\"name\" size=\"25\" maxlength=\"50\"></td></tr>";
> echo "<tr><td><font face=\"Verdana\" size=\"2\">Email:</td><td> <input
> type=\"text\" name=\"email\" size=\"25\"></td></tr>";
> echo "<tr><td><font face=\"Verdana\" size=\"2\">Language:</td><td> <input
> type=\"text\" name=\"language\" size=\"25\"></td></tr>";
> echo "<tr><td><font face=\"Verdana\" size=\"2\">Subject:</td><td> <input
> type=\"text\" name=\"subject\" size=\"25\"></td></tr>";
> echo "<tr><td valign=\"top\"><font face=\"Verdana\"
> size=\"2\">Comments:</td><td> <textarea name=\"comments\" rows=\"12\"
> cols=\"40\"></textarea></td></tr>";
> echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\"
> name=\"submit\" value=\" Send Script \"></td></tr><tr><td><font size=\"1\"
> color=\"red\">IP: $REMOTE_ADDR</font></td></tr></table>";
> echo "</form>";
> }
> else {
>
> echo "<div align=\"center\">";
> echo "Thank you $cleanname for your suggestion. <br><br>";
> echo "</div><div align=\"left\">";
> echo "<b><font face=\"Verdana\" size=\"2\"> Name: </b><i> $cleanname
> </i><br>";
> echo "<b><font face=\"Verdana\" size=\"2\"> E-Mail: </b><i> $clean_email
> </i><br>";
> echo "<b><font face=\"Verdana\" size=\"2\"> Suggestion: </b><br>";
> echo "<font face=\"Verdana\" size=\"2\"><i> $clean_suggestion </i>";
> echo "</div>";
> file://email suggestion
>
> file://$unique_id=Substr(md5(uniqid(time())),1,7);
> $unique_id=time();
> file://$time_signed=date("l dS of F Y @h:i:s A");
> $time_signed=convertGMT();
> $email_body="The following suggestion was submitted by ";
> $email_body=$email_body . "$cleanname\n\n";
> $email_body=$email_body . "$clean_suggestion\n\n";
> $email_body=$email_body . "Time: $time_signed\n\n";
> $email_body=$email_body . "IP: $REMOTE_ADDR\n\n";
> mail("[EMAIL PROTECTED]","Suggestion
> ($unique_id)",$email_body,"From: $email");
> }
> }
>
> ?>
>
>
--- End Message ---