php-windows Digest 18 Nov 2001 08:00:11 -0000 Issue 860
Topics (messages 10465 through 10470):
PHP 4.06 - 1.3.22 (Win 98) Single user
10465 by: Bill Borum
Re: [PHP] Apache 2.0.28
10466 by: Jobarr
PHPDownload - platform differences?
10467 by: Emil Chow
extensions and ini.Help.
10468 by: Jovanovic
string comp error
10469 by: xiaoyf
Use sockets under windows
10470 by: Walter Gyr
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 have 2 almost identical php header scripts, both of which work beautifully
online through my Linux Server. However, one does not through my Windows 98
localhost. The first 45 lines of both scripts are identical and appear
below my signature if you need to see them. The snippets below began at
line 46 in each instance.
<snippet_1>
SetCookie ("agent", "$agent");
SetCookie ("ver", "$version"); /* Opera ignores $version as a cookie_name
*/
SetCookie ("major", "$major");
SetCookie ("minor", "$minor");
header("Location: http://localhost/Apache/htdocs/cookietext.php");
exit;
?>/* EOF - This remark not in doc */
</snippet_1>
<snippet_2>
SetCookie ("agent", "$agent");
SetCookie ("ver", "$version"); /* Opera ignores $version as a cookie_name
*/
SetCookie ("major", "$major");
SetCookie ("minor", "$minor");
if (($agent != "Netscape") || ($version > 5.00)) {
header("Location: http://localhost/Apache/htdocs/cookietext.php");
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> /* Valid document below */
</snippet_2>
The redirects work without a problem in both cases. However, when run
through localhost, the cookie variables are not usable by cookietext.php in
the case of <snippet_2>. Wherever I try to make use of these variables, I
receive an undefined variable error. Reloading or refreshing does no good.
The behavior is universal across all browsers tested.
It appears, in the case of snippet_2, that the cookie variables are either
not being set or localhost is not recognizing the redirect as an HTTP
request. The question is, WHY? I am hoping that it is a simple
configuration problem and that some kind soul on this group has the answer.
TIA,
Bill
<lines 1_45>
<?
$reUA = "/^(\w+)\/((\d+).(\d+))/";
$reIE = "/(MSIE) ((\d+).(\d+))/";
$reNS6 = "/(Netscape)\d*\/((\d+).(\d+))/i";
$reOpera = "/(Opera) ((\d+).(\d+))/i";
$reWebTV = "/(WebTV)\/((\d+).(\d+))/i";
preg_match($reUA, $HTTP_USER_AGENT, $RegExp);
$agent = $RegExp[1];
$version = $RegExp[2];
$major = $RegExp[3];
$minor = $RegExp[4];
if (preg_match($reIE, $HTTP_USER_AGENT, $RegExp)) {
$agent = $RegExp[1];
$version = $RegExp[2];
$major = $RegExp[3];
$minor = $RegExp[4];
}
if (preg_match($reNS6, $HTTP_USER_AGENT, $RegExp)) {
$agent = $RegExp[1];
$version = $RegExp[2];
$major = $RegExp[3];
$minor = $RegExp[4];
}
if (preg_match($reOpera, $HTTP_USER_AGENT, $RegExp)) {
$agent = $RegExp[1];
$version = $RegExp[2];
$major = $RegExp[3];
$minor = $RegExp[4];
}
if (preg_match($reWebTV, $HTTP_USER_AGENT, $RegExp)) {
$agent = $RegExp[1];
$version = $RegExp[2];
$major = $RegExp[3];
$minor = $RegExp[4];
}
if (($agent=="Mozilla") && ($version > 4.00) && ($version < 5.00)) {
$agent = "Netscape";
}
</lines 1-45>
--- End Message ---
--- Begin Message ---
I read something saying that the API changed from 2.026 to 2.0.28 and when I
tried using a Apache2 php module, it said it was not compatible with this
version of Apache.
-Jobarr
"Vincent Stoessel" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The current php will work with apache 2.x
> use: --with-apxs2
> when you configure php
--- End Message ---
--- Begin Message ---
I have seen a program called PHPDownload that uses MySQL to store a download
database. Since the script is no longer supported, I just have some general
questions, being new to PHP and all. Are there any real big compatibility
issues when trying to use it instead on IIS/NT5 when it was meant for
Apache/Linux? Is the "Undefined variable: CurrentPage " characterisitic of
running something under a different platform? If it is a better idea to use
a different free script, please recommend one that can store a database of
stuff to download with descriptions (almost like a mini-download.com).
Thanks.
--- End Message ---
--- Begin Message ---
Hi...
Anyone got a clue for this piece of "bad luck"?
I'm on win2k pro + IIS5 +php4.0.6 cgi installation. It works fine
untill I try to load php_interbase.dll extension and this is how it goes:
"Unable to load dynamic library '...' - The specified procedure
could not be found". Three points stand for:
./ (this one is by default),
d:\php,
d:\php\extensions,
d:\winnt and
d:\winnt\system32,
wherever I choose to put the dll. Those folders where declared in
the above fashion and with/without quotes, with slash/backslash.
( other *.ini-s, for example, to assign folders don't use quotes and
use \ instead of /) - ( Of course I had Interbase server running all the
time.),
and I wasn't lazy to reboot the system every time...
Now count the combinations...
Tiresome...
Does anybody know how to solve this?
Zoran
ps.
I tried to use my database, and one example mdb, with php through ODBC -
that was a laugh:
'Database name could not be found' for odbc_connect(dns,user,pswd)...
(c/c++ is maybe harder to learn, but I have never had this much fuss with
it.)
ODBC support is supposed to be built in, or is it?
--- End Message ---
--- Begin Message ---
I have seen a program
if ("32060199990000780"=="32060199990000782") {
echo "ok<br>";
}
else {
echo "not <br>";
}
it comp is ok.
this is error ! (0==2)
--- End Message ---
--- Begin Message ---
Hi
I'm looking for a sample about sockets for windows NT.
I want test the sample from manual bad doesnt work with Windows.
I know that the window version has diffrent function names.
?php
error_reporting (E_ALL);
set_time_limit (0);
$address = '192.168.1.2';
$port = 4711;
if (($sock = socket_create (AF_INET, SOCK_STREAM, 0)) < 0) {
echo "socket() failed: reason: " . strerror ($sock) . "\n";
}
if (($ret = socket_bind ($sock, $address, $port)) < 0) {
echo "bind() failed: reason: " . strerror ($ret) . "\n";
}
if (($ret = socket_listen ($sock, 5)) < 0) {
echo "listen() failed: reason: " . strerror ($ret) . "\n";
}
do {
if (($msgsock = socket_accept($sock)) < 0) {
echo "accept_connect() failed: reason: " . strerror ($msgsock) .
"\n";
break;
}
do {
$buf = '';
$ret = socket_read ($msgsock, $buf, 2048);
if ($ret < 0) {
echo "read() failed: reason: " . strerror ($ret) . "\n";
break 2;
}
if ($ret == 0) {
break 2;
}
$buf = trim ($buf);
if ($buf == 'quit') {
close ($msgsock);
break 2;
}
$talkback = "PHP: You said '$buf'.\n";
socket_write ($msgsock, $talkback, strlen ($talkback));
echo "$buf\n";
} while (true);
socket_close ($msgsock);
} while (true);
socket_close ($sock);
?>
The error message is always "Cannot bind the address" ??
Thanks very much
Walter
--- End Message ---