php-windows Digest 15 Oct 2001 13:36:29 -0000 Issue 806
Topics (messages 9844 through 9851):
authorization system
9844 by: jax.woh.rr.com
Re: PHP inder Windows XP
9845 by: Nick Ooka
9849 by: Jan Peter Sigmond
Re: HTTP_SERVER_VARS
9846 by: Oronzo \(detto Enzo\) Suma
Excuse the dumb question about page stats...
9847 by: Nick Allen
Authentication
9848 by: Sergey Zorchenko
Re: can't read binary files containg '0x0' character
9850 by: Svensson, B.A.T.
installing on Unix....
9851 by: Martin.Andrew
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 having troubles connecting and a couple of errors also.
Could somebody please point me in the right direction?
Thanks in advance
// login.php
<html>
<body>
<form>
<input type="text" name="name" value="username" size="35"
maxlength=""><br />
<input type="text" name="password" value="password"
size="35" maxlength=""><br />
<p><input type="submit" value="Login.."></p>
</form>
<?php
// login to the database
mysql_host = www.site.net;
mysql_user = username;
mysql_pass = password;
$mylink = mysql_connect('mysql_host', 'mysql_user',
'mysql_pass')
or die ("could not connect");
mysql_select_db("dbname")
or die ("could not select db");
// login
$query = "SELECT * FROM 'login' WHERE Name = '$name'";
$result = mysql_query($query);
$numR = mysql_num_rows($result);
if ($numR == 1) {
print "Login Complete";
}
else {
print "Your name was not found - Please register";
}
?>
</body>
</html>
// register.php
<html>
<body>
<form>
<input type="text" name="name" value="username" size="35"
maxlength=""><br />
<input type="text" name="password" value="password"
size="35" maxlength=""><br />
<input type="text" name="email" value="email" size="35"
maxlength=""><br />
<input type="text" name="url" value="url" size="35"
maxlength=""><br />
<p><input type="submit" value="Register.."></p>
</form>
<?php
// login to the database
mysql_host = www.site.net;
mysql_user = username;
mysql_pass = password;
$mylink = mysql_connect('mysql_host', 'mysql_user',
'mysql_pass')
or die ("could not connect");
mysql_select_db("dbname")
or die ("could not select db");
// registration
$query = "INSERT INTO 'login' (name, password, email, url)
VALUES ('$name', 'password', 'email', 'url')";
$result = mysql_query($query);
?>
</body>
</html>
--- End Message ---
--- Begin Message ---
I'm not too sure, but did you edit your "httpd.conf" file
to allow the use of PHP with Apache?
nick
On Sun, 14 Oct 2001 11:31:09 +0200
"Jan Peter Sigmond" <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I'm having some problems with php under Windows XP.
> I just installed php in combination with Apache. Apache is working fine, but
> when ik ga to a local .php site, it only gives a white screen. I don't get
> errors or something, so the link between apache and php is there. But why
> doesn't the php.exe process the page?Can somebody give me some tips or
> solutions?
>
> cya Jan Peter
> (Netherlands)
>
>
>
> --
> 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 ---
yeah i did
i already solved the problem...
it was a config problem.
cya Jan Peter
(Netherlands)
"Nick Ooka" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm not too sure, but did you edit your "httpd.conf" file
> to allow the use of PHP with Apache?
>
> nick
>
> On Sun, 14 Oct 2001 11:31:09 +0200
> "Jan Peter Sigmond" <[EMAIL PROTECTED]> wrote:
>
> > Hi!
> >
> > I'm having some problems with php under Windows XP.
> > I just installed php in combination with Apache. Apache is working fine,
but
> > when ik ga to a local .php site, it only gives a white screen. I don't
get
> > errors or something, so the link between apache and php is there. But
why
> > doesn't the php.exe process the page?Can somebody give me some tips or
> > solutions?
> >
> > cya Jan Peter
> > (Netherlands)
> >
> >
> >
> > --
> > 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 ---
You can control if this variable are impostate with script in your server
root
<?
phpinfo();
?>
if result the execution this file have the system variable in the file it is
impostate else you control the php.ini if impostete on ON the relative
variable
"Steen rabøl" <[EMAIL PROTECTED]> ha scritto nel messaggio
002901c153cc$e64ca120$0300000a@srjhp">news:002901c153cc$e64ca120$0300000a@srjhp...
Hi
If you run php on IIS as ISAPI, then you access to $HTTP_SERVER_VARS, but if
you run php as CGI you don't, how can I get $HTTP_SERVER_VARS working when
running php as CGI?
Thanks on advance
Steen
--- End Message ---
--- Begin Message ---
We've a need to provide page stats so we can see what pages people are
visiting.
It is the case that every page in our web will need to be a PHP page then?
I'm not keen to do this just for page stats as it will mean additional
processing overhead but is that my only option?
I'm running PHP4.0.6 on Apache 1.3.20 for Win32.
Also - would you suggest that I simply make every page a PHP page and then
include the counter code as an include at the beginning of every page?
Thanks in advance,
Nick.
--- End Message ---
--- Begin Message ---
Can anyone advice me any to realize a directory authentication with
Apache/php4.0.6/MySQL ?
I mean that Apache must to use MySQL database for authentication..
plz :)
i have made an 'access.php' that contains:
---------------------------
function deny() {
header("WWW-Authenticate: Basic realm=\"My Realm\"");
header("HTTP/1.0 401 Unauthorized");
die ("sorry, access denied\n");
}
if(isset($PHP_AUTH_USER)) {
$showqueries = 0;
$user = $db->query("SELECT nick, email FROM members WHERE name =
'$PHP_AUTH_USER' AND pass = PASSWORD('$PHP_AUTH_PW')");
$row = $user->fetch();
if (!isset($row->nick)){
deny();
}
} else {
deny();
}
-----------------------------
but this means , that i need to inlcude this file to _all_ php-files in
'secure' directory :(
--- End Message ---
--- Begin Message ---
Feeding the function with the proper arguments will
allow one to make things (almost) behave in the way
one would like to predict them. However trying to relay
on special features found in one API is just asking
for trouble when migrating them to another API.
Assuming php just wraps C's fopen(), then the possible
mode to provide fopen() with should be:
"r", "w", "a"
"rb", "wb", "ab"
"r+", "w+", "a+"
"r+b" or "rb+",
"w+b" or "wb+",
"a+b" or "ab+",
r and w is read respectively write (text) open mode.
"w" mode creates a new file or truncates an existing
file on opening. Mode "a" opens the file in append
mode and adds data to the end of the file.
An Additional mode "b" opens the file in binary mode
- that is no character translation is performed.
Adding mode "+" opens the file for both reading and
writing. However, "w+" creates a new file if none
existing or truncates an existing file on opening.
Opening a file in binary mode will ensure that you
read the raw file. Opening a file in text mode makes
the system parse the file before returning data to
the API programmer. The behavior of text mode is
system dependent, even sometimes compiler dependent.
For example on some platforms (not mentioning any
particular, but it is M$ environment) closing a text
file in write mode might cause additional junk be
appended to the end of the file - causing lots of
problem for other applications.
Cheers,
/Anders
>-----Original Message-----
>From: Roland Divin [mailto:[EMAIL PROTECTED]]
>Sent: Friday, October 12, 2001 9:33 PM
>To: [EMAIL PROTECTED]
>Subject: Re: [PHP-WIN] can't read binary files containg '0x0' character
>
>
>Thanks, you're right. Now it works even using dll module (not CGI) version.
>Anyway it is strange that the behavior of the fread function is conditioned
>whether I use dll module or CGI...
>
>Roland
>
>"Mark" <[EMAIL PROTECTED]> píse v diskusním príspevku
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>On Fri, 12 Oct 2001 21:00:24 +0200, Roland Divin wrote:
>>Hi,
>>I can'r read binary file that contains '0x0' character. Reading
>>process
>>stops after reading '0x0' character on windows version of PHP. On
>>Linux it
>>does not.
>>
>>That same code gives another result on windows then on linux. Why?
>>(Consider file text.txt is contaning '0x0' characters. I'm using
>>PHP4 build
>>from Jun 22 2001.)
>>
>>$filename = "text.txt";
>>$fd = fopen ($filename, "r");
>
>should be "rb" for binary files.
>
>>$contents = fread ($fd, filesize ($filename));
>>fclose ($fd);
>>echo $contents;
>>echo strlen($contents);
>>for($i=0;$i<strlen($contents);$i++)
>>{ echo "$i:".ord($contents[$i])."<br>"; }
>>
>>Isn't it bug?
>>
>>Thanks
>>Roland Divin
>>
>>
>>
>
>
>--
>Mark, [EMAIL PROTECTED] on 10/11/01
>
>
>
>
>
>--
>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 ---
I have successfully installed php4 on windows all works fine.
I have been using this version and uploading the results to a (pre
installed) unix server with php3 installed.
But the time has come to upgrade the server with the PHP4 etc....
So for testing purposes a test server was installed with the same set up as
the current server (php3, mysql etc), from this I want to update the php
version
What I have noticed is that while PHP4 is working fine without problems
my_sql isn't!!
I keep getting the error:
Fatal error: Call to undefined function: mysql_pconnect() in
../include/db_mysql.inc on line 73
I have noticed that in the php3.ini the extension directory and mysql.so is
set (as shown below)
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
extension_dir = /usr/lib/php3/cgi ;directory in which
the loadable extensions (modules) reside
;unix extension
extension=mysql.so
So I try using the same directory but still no luck!
Anybody know how to enable the My_sql function for php4 on a UNix system?
Thanks.
--- End Message ---