php-windows Digest 17 Jun 2003 21:05:04 -0000 Issue 1781
Topics (messages 20370 through 20393):
Re: PHP mySQL testing server does not map to the URL
20370 by: malte
Re: Using the installshield vs manually
20371 by: Daniel Crompton
20379 by: Phil Driscoll
20383 by: John Lim
20384 by: Phil Driscoll
Password generator
20372 by: Davy Obdam
20373 by: Daniel Beulshausen
20374 by: Luis Moreira
20375 by: Davy Obdam
20376 by: toby z
20377 by: toby z
20392 by: Andrei BEJENARU
PHP i need help please
20378 by: Kevin Ison
20381 by: Daniel Beulshausen
20382 by: Kevin Ison
Re: Undefined variables
20380 by: DvDmanDT
Re: Back button error
20385 by: Harpreet
20387 by: Harpreet
20388 by: Stephen
20389 by: Cristian MARIN
20390 by: Cristian MARIN
Re: Subject: Re: User Authentication...
20386 by: Cristian MARIN
20393 by: Guru P Chaturvedi
Installation
20391 by: Anand Tomar
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 ---
PhpMyAdmin needs to be in your webservers document root. If that is the case
you can access it through your webserver
(http://localhost/phpmyadmin/index.php)
note that the link above may vary depending on your configuration
malte
----- Original Message -----
From: "Ildiko Nyari" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 17, 2003 2:21 AM
Subject: [PHP-WIN] Fw: PHP mySQL testing server does not map to the URL
In fact I am not sure I have installed php correctly. I have downloaded the
php files and Apache installed, and alos the phpmyadmin unzipped
here:
C:\mysql\bin where the mysql database is
and
C:\php where php is
C:\phpmyadmin is here
And now, how can I open phpmyadmin?
How should I set up my testing server map to the WHERE?
thanks,
ildiko
----- Original Message -----
From: Ildiko Nyari
To: [EMAIL PROTECTED]
Sent: Monday, June 16, 2003 8:05 PM
Subject: Fw: PHP mySQL testing server does not map to the URL
Somebody? Nobody?
C:\mysql\bin where the mysql database is
and
C:\php where php is
C:\phpmyadmin is here
how the hell can I make them running together,
testing server map to the WHERE?
thanks,
ildiko
----- Original Message -----
From: Ildiko Nyari
To: [EMAIL PROTECTED]
Sent: Monday, June 16, 2003 6:30 PM
Subject: PHP mySQL testing server does not map to the URL
Hello,
I just can't go beyond this point. I am trying to connect the website to the
localhost server (PHP mySQL) but I always get this message.
Any advise?
Thanks,
ildiko
The testing server specified for this site does not map to the
http://localhost/website/_MMServerScript/MMHTTPDB.php URL. Verify that the
URL Prefix maps to the root of the site.
--- End Message ---
--- Begin Message ---
Hi
Thanks for the feedback. I think we are talking about different things
here.
I am asking specifically about the PHP installshield vs the manual way and
any security issues/differences the installsheild in itself creates.
The other things you mention like making sure win2k is patched with the
latest updates, and
make sure ive got a firewall etc is all irrelevant, as this is all
obviously done.
I'm not asking a newbie question about how to setup a server!!, im asking
specifically about the php installation only.
> >
> > My only concern is any security issue. I'm still unsure exactly what
> > security issue people are reffering to.
> > i.e. what are the consequences of using the installshield in real terms.
>
> Exactly the same as using the zip distribution and installing
php.ini-dist.
> Securing your Windows web server is a huge issue - the php.ini settings
really
> are just a tiny part of the picture which includes:
> making sure your web server is patched to the hilt
> making sure your web server is configured securely
> making sure your os is patched to the hilt
> making sure you are running no unnecessary services
> making sure your own php scripts are secure and that unexpected input
can't
> give attackers access to things you don't want them to access
> making sure that you trust no input whatsoever from the internet
> making sure your windows server is sat behind an industral strength
firewall
> which is fowarding probably only port 80 requests to your windows machine
>
> If you don't feel you've already spent hundred of hours on the above, and
you
> have a good grasp of what you need to do, then you've already been cracked
> and you just don't know it :)
>
> I suspect google is your best bet for advice on all of the above.
>
> Cheers
> --
> Phil Driscoll
--- End Message ---
--- Begin Message ---
> I'm not asking a newbie question about how to setup a server!!, im asking
> specifically about the php installation only.
In this respect, both methods are identical. You will end up with the same
php.ini file. If you then want to further modify the file, you need to get in
there with a text editor in both cases.
Cheers
--
Phil Driscoll
--- End Message ---
--- Begin Message ---
"Phil Driscoll" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> As mentioned, this may be fine for a test setup - but for a production
setup
> you are quite likely to want the extra performance you would get from a
sapi
> installation and you may well need some extension modules which are only
> shipped with the zip distribution. With either distribution, if you are
going
> to expose your system to the internet, you need to very carefully evaluate
> many security issues - the settings in php.ini being only a very small
part
> of the whole picture.
>
Hi Phil,
Haven't corresponded with you for a long while. I created a windows
installer
for PHP 4.0.x a long time ago, and gave up because i thought you were doing
a fine job with the default PHP installer.
Recently i discovered FastCGI and Turck-MMCache which appear to work
very nicely on IIS/Windows. FastCGI is a pretty reliable sapi, and Turck
MMCache appears to be the only major open source Accelerator to work
well on Windows.
I am building a new IIS installer that includes FastCGI and Turck MMCache
bundled in. It's still in beta (because Turck MMCache has some issues with
FastCGI that the author is fixing). If you are interested in finding out
more,
let me know and i will mail the beta url to you.
> My own personal journey in this regard was to abandon the Windows
platform, as
> I didn't think it was possible for me to learn enough to make and keep a
> Windows box secure :)
With the latest windows update patch system from Microsoft, security is not
as big an issue as it used to be. In fact, if you look at IIS 6.0, you will
see that
it has improved a lot, taking some of the best ideas of Apache...
Bye, John Lim
PS: Daniel, if you are also interested in trying the installer, let me know.
--- End Message ---
--- Begin Message ---
On Tuesday 17 June 2003 4:10 pm, John Lim wrote:
> I am building a new IIS installer that includes FastCGI and Turck MMCache
> bundled in. It's still in beta (because Turck MMCache has some issues with
> FastCGI that the author is fixing). If you are interested in finding out
> more,
> let me know and i will mail the beta url to you.
I've long since abandoned Windows and now only use it to build the php
installer! You perhaps need to know that Wez Furlong is writing some php
scripts which will automatically build an msi installer for php. These will
build installation versions of the windows snapshots builds, as well, I
guess, as the main releases. I don't know how far he has got with the
project. I sent him all the sources for the IIS configuration stuff, but it
might be a good idea to pool resources. You can contact Wez at
[EMAIL PROTECTED]
Cheers
--
Phil Driscoll
--- End Message ---
--- Begin Message ---
Hi people,
I have to make a password generator, but i have a little problem.
- It needs to generate password 8 characters long, and including 1 or 2
special characters(like #$%&*@).
- Those special characters can never appear as the first or last
character in the string... anywhere between is fine.
I have a password generator script now that does the first thing... but
the special character can be in front or back of the string wich it
shouldnt.. i have been looking on the web for this but i havent found
the answer. Below is my scripts so far..
Any help is appreciated, thanks for your time,
Best regards,
Davy Obdam
----------------------------------------------------------------------------------------------------------------
<?php
// A function to generate random alphanumeric passwords in PHP
// It expects to be passed a desired password length, but it
// none is passed the default is set to 8 (you can change this)
function generate_password($length = 8) {
// This variable contains the list of allowable characters
// for the password. Note that the number 0 and the letter
// 'O' have been removed to avoid confusion between the two.
// The same is true of 'I' and 1
$allowable_characters = "abcdefghefghijklmnopqrstuvwxyz0123456789%#*&";
// We see how many characters are in the allowable list
$ps_len = strlen($allowable_characters);
// Seed the random number generator with the microtime stamp
// (current UNIX timestamp, but in microseconds)
mt_srand((double)microtime()*1000000);
// Declare the password as a blank string.
$pass = "";
// Loop the number of times specified by $length
for($i = 0; $i < $length; $i++) {
// Each iteration, pick a random character from the
// allowable string and append it to the password.
$pass .= $allowable_characters[mt_rand(0,$ps_len-1)];
}
// Retun the password we've selected
return $pass;
}
$password = generate_password();
echo $password;
?>
--
-----------------------------------------------------------------------
Davy Obdam
Web application developer
Networking4all
email: [EMAIL PROTECTED]
email: [EMAIL PROTECTED]
internet: http://www.networking4all.com
-----------------------------------------------------------------------
--- End Message ---
--- Begin Message ---
At 11:45 17.06.2003 +0200, Davy Obdam wrote:
Hi people,
I have to make a password generator, but i have a little problem.
- It needs to generate password 8 characters long, and including 1 or 2
special characters(like #$%&*@).
- Those special characters can never appear as the first or last character
in the string... anywhere between is fine.
I have a password generator script now that does the first thing... but
the special character can be in front or back of the string wich it
shouldnt.. i have been looking on the web for this but i havent found the
answer. Below is my scripts so far..
Any help is appreciated, thanks for your time,
please don't cross-post.
>>>
<?php
function generatePassword( $length = 8 ) {
$alphaNumChar = array(
'a','b','c','d','e','f','g','h','e','f','g','h','i','j','k',
'l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6',
'7','8','9' );
$specialChar = array( '%','#','*','&' );
$allChars = array_merge( $alphaNumChar, $specialChar );
$returnValue = '';
mt_srand( lcg_value() * 10000 + time() );
$returnValue .= $alphaNumChar[ array_rand( $alphaNumChar ) ];
if( ( $length -= 2 ) > 0 ) {
while( $length-- > 0 ) {
$returnValue .= $allChars[ array_rand( $allChars ) ];
}
}
$returnValue .= $alphaNumChar[ array_rand( $alphaNumChar ) ];
return $returnValue;
}
echo generatePassword();
?>
<<<
mit freundlichen grüßen aus berlin,
daniel
/*--
Daniel Beulshausen - [EMAIL PROTECTED]
Using PHP on Windows? http://www.php4win.com
--- End Message ---
--- Begin Message ---
Have you tried to insert an "IF" statement, checking if the index on the
"FOR" cycle is equal to "1" or to the last possible value ?
:-)
----- Original Message -----
From: "Davy Obdam" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>; "PHP-WIN"
<[EMAIL PROTECTED]>; "PHP-DB" <[EMAIL PROTECTED]>
Sent: Tuesday, June 17, 2003 10:45 AM
Subject: [PHP-WIN] Password generator
> Hi people,
>
> I have to make a password generator, but i have a little problem.
>
> - It needs to generate password 8 characters long, and including 1 or 2
> special characters(like #$%&*@).
> - Those special characters can never appear as the first or last
> character in the string... anywhere between is fine.
>
> I have a password generator script now that does the first thing... but
> the special character can be in front or back of the string wich it
> shouldnt.. i have been looking on the web for this but i havent found
> the answer. Below is my scripts so far..
>
> Any help is appreciated, thanks for your time,
>
> Best regards,
>
> Davy Obdam
>
> --------------------------------------------------------------------------
--------------------------------------
>
> <?php
> // A function to generate random alphanumeric passwords in PHP
> // It expects to be passed a desired password length, but it
> // none is passed the default is set to 8 (you can change this)
> function generate_password($length = 8) {
>
> // This variable contains the list of allowable characters
> // for the password. Note that the number 0 and the letter
> // 'O' have been removed to avoid confusion between the two.
> // The same is true of 'I' and 1
> $allowable_characters =
"abcdefghefghijklmnopqrstuvwxyz0123456789%#*&";
>
> // We see how many characters are in the allowable list
> $ps_len = strlen($allowable_characters);
>
> // Seed the random number generator with the microtime stamp
> // (current UNIX timestamp, but in microseconds)
> mt_srand((double)microtime()*1000000);
>
> // Declare the password as a blank string.
> $pass = "";
>
> // Loop the number of times specified by $length
> for($i = 0; $i < $length; $i++) {
>
> // Each iteration, pick a random character from the
> // allowable string and append it to the password.
> $pass .= $allowable_characters[mt_rand(0,$ps_len-1)];
>
> }
>
> // Retun the password we've selected
> return $pass;
> }
>
> $password = generate_password();
> echo $password;
>
> ?>
>
> --
> -----------------------------------------------------------------------
> Davy Obdam
> Web application developer
>
> Networking4all
> email: [EMAIL PROTECTED]
> email: [EMAIL PROTECTED]
> internet: http://www.networking4all.com
> -----------------------------------------------------------------------
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Thanks for you reactions people, i have found the solution
Best regards,
Davy Obdam
Met vriendelijke groeten uit Den Haag;-)
Daniel Beulshausen wrote:
At 11:45 17.06.2003 +0200, Davy Obdam wrote:
Hi people,
I have to make a password generator, but i have a little problem.
- It needs to generate password 8 characters long, and including 1 or
2 special characters(like #$%&*@).
- Those special characters can never appear as the first or last
character in the string... anywhere between is fine.
I have a password generator script now that does the first thing...
but the special character can be in front or back of the string wich
it shouldnt.. i have been looking on the web for this but i havent
found the answer. Below is my scripts so far..
Any help is appreciated, thanks for your time,
please don't cross-post.
>>>
<?php
function generatePassword( $length = 8 ) {
$alphaNumChar = array(
'a','b','c','d','e','f','g','h','e','f','g','h','i','j','k',
'l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6',
'7','8','9' );
$specialChar = array( '%','#','*','&' );
$allChars = array_merge( $alphaNumChar, $specialChar );
$returnValue = '';
mt_srand( lcg_value() * 10000 + time() );
$returnValue .= $alphaNumChar[ array_rand( $alphaNumChar ) ];
if( ( $length -= 2 ) > 0 ) {
while( $length-- > 0 ) {
$returnValue .= $allChars[ array_rand(
$allChars ) ];
}
}
$returnValue .= $alphaNumChar[ array_rand( $alphaNumChar ) ];
return $returnValue;
}
echo generatePassword();
?>
<<<
mit freundlichen grüßen aus berlin,
daniel
/*--
Daniel Beulshausen - [EMAIL PROTECTED]
Using PHP on Windows? http://www.php4win.com
--
-----------------------------------------------------------------------
Davy Obdam
Web application developer
Networking4all
email: [EMAIL PROTECTED]
email: [EMAIL PROTECTED]
internet: http://www.networking4all.com
-----------------------------------------------------------------------
--- End Message ---
--- Begin Message ---
and how did you accomplish that ?????
toby
--- Davy Obdam <[EMAIL PROTECTED]> wrote: > Thanks for you
reactions people, i have found the solution
>
> Best regards,
>
> Davy Obdam
>
> Met vriendelijke groeten uit Den Haag;-)
>
> Daniel Beulshausen wrote:
>
> > At 11:45 17.06.2003 +0200, Davy Obdam wrote:
> >
> >> Hi people,
> >>
> >> I have to make a password generator, but i have a little
> problem.
> >>
> >> - It needs to generate password 8 characters long, and including
> 1 or
> >> 2 special characters(like #$%&*@).
> >> - Those special characters can never appear as the first or last
>
> >> character in the string... anywhere between is fine.
> >>
> >> I have a password generator script now that does the first
> thing...
> >> but the special character can be in front or back of the string
> wich
> >> it shouldnt.. i have been looking on the web for this but i
> havent
> >> found the answer. Below is my scripts so far..
> >> Any help is appreciated, thanks for your time,
> >
> >
> > please don't cross-post.
> >
> > >>>
> > <?php
> > function generatePassword( $length = 8 ) {
> > $alphaNumChar = array(
> > 'a','b','c','d','e','f','g','h','e','f','g','h','i','j','k',
> >
> >
>
'l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6',
> > '7','8','9' );
> > $specialChar = array( '%','#','*','&' );
> > $allChars = array_merge( $alphaNumChar, $specialChar );
> >
> > $returnValue = '';
> >
> > mt_srand( lcg_value() * 10000 + time() );
> > $returnValue .= $alphaNumChar[ array_rand( $alphaNumChar
> ) ];
> >
> > if( ( $length -= 2 ) > 0 ) {
> > while( $length-- > 0 ) {
> > $returnValue .= $allChars[ array_rand(
> > $allChars ) ];
> > }
> > }
> >
> > $returnValue .= $alphaNumChar[ array_rand( $alphaNumChar
> ) ];
> > return $returnValue;
> > }
> >
> > echo generatePassword();
> > ?>
> > <<<
> >
> > mit freundlichen grüßen aus berlin,
> > daniel
> >
> > /*--
> > Daniel Beulshausen - [EMAIL PROTECTED]
> > Using PHP on Windows? http://www.php4win.com
>
>
> --
>
-----------------------------------------------------------------------
> Davy Obdam
> Web application developer
>
> Networking4all
> email: [EMAIL PROTECTED]
> email: [EMAIL PROTECTED]
> internet: http://www.networking4all.com
>
-----------------------------------------------------------------------
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/
--- End Message ---
--- Begin Message ---
and how did you accomplish that ?????
toby
--- Davy Obdam <[EMAIL PROTECTED]> wrote: > Thanks for you
reactions people, i have found the solution
>
> Best regards,
>
> Davy Obdam
>
> Met vriendelijke groeten uit Den Haag;-)
>
> Daniel Beulshausen wrote:
>
> > At 11:45 17.06.2003 +0200, Davy Obdam wrote:
> >
> >> Hi people,
> >>
> >> I have to make a password generator, but i have a little
> problem.
> >>
> >> - It needs to generate password 8 characters long, and including
> 1 or
> >> 2 special characters(like #$%&*@).
> >> - Those special characters can never appear as the first or last
>
> >> character in the string... anywhere between is fine.
> >>
> >> I have a password generator script now that does the first
> thing...
> >> but the special character can be in front or back of the string
> wich
> >> it shouldnt.. i have been looking on the web for this but i
> havent
> >> found the answer. Below is my scripts so far..
> >> Any help is appreciated, thanks for your time,
> >
> >
> > please don't cross-post.
> >
> > >>>
> > <?php
> > function generatePassword( $length = 8 ) {
> > $alphaNumChar = array(
> > 'a','b','c','d','e','f','g','h','e','f','g','h','i','j','k',
> >
> >
>
'l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6',
> > '7','8','9' );
> > $specialChar = array( '%','#','*','&' );
> > $allChars = array_merge( $alphaNumChar, $specialChar );
> >
> > $returnValue = '';
> >
> > mt_srand( lcg_value() * 10000 + time() );
> > $returnValue .= $alphaNumChar[ array_rand( $alphaNumChar
> ) ];
> >
> > if( ( $length -= 2 ) > 0 ) {
> > while( $length-- > 0 ) {
> > $returnValue .= $allChars[ array_rand(
> > $allChars ) ];
> > }
> > }
> >
> > $returnValue .= $alphaNumChar[ array_rand( $alphaNumChar
> ) ];
> > return $returnValue;
> > }
> >
> > echo generatePassword();
> > ?>
> > <<<
> >
> > mit freundlichen grüßen aus berlin,
> > daniel
> >
> > /*--
> > Daniel Beulshausen - [EMAIL PROTECTED]
> > Using PHP on Windows? http://www.php4win.com
>
>
> --
>
-----------------------------------------------------------------------
> Davy Obdam
> Web application developer
>
> Networking4all
> email: [EMAIL PROTECTED]
> email: [EMAIL PROTECTED]
> internet: http://www.networking4all.com
>
-----------------------------------------------------------------------
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/
--- End Message ---
--- Begin Message ---
Here's a little function that could help you...
It uses the ASCII table to generate the characters and it still needs to be
customized for any length
and to deny the use of the special characters...
Don't forget to set the mt seed!
function generatePassword() {
$passwd = "";
while(strlen($passwd)<10) {
switch(mt_rand(1,4)) {
case 1:
$tmp = chr(mt_rand(33,46));
if ($tmp!="'" && $tmp!="\"") {
$passwd .= $tmp;
}
break;
case 2:
$passwd .= chr(mt_rand(48,57));
break;
case 3:
$passwd .= chr(mt_rand(65,90));
break;
case 4:
$passwd .= chr(mt_rand(97,122));
break;
}
}
return $passwd;
}
"Davy Obdam" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi people,
>
> I have to make a password generator, but i have a little problem.
>
> - It needs to generate password 8 characters long, and including 1 or 2
> special characters(like #$%&*@).
> - Those special characters can never appear as the first or last
> character in the string... anywhere between is fine.
>
> I have a password generator script now that does the first thing... but
> the special character can be in front or back of the string wich it
> shouldnt.. i have been looking on the web for this but i havent found
> the answer. Below is my scripts so far..
>
> Any help is appreciated, thanks for your time,
>
> Best regards,
>
> Davy Obdam
>
> --------------------------------------------------------------------------
--------------------------------------
>
> <?php
> // A function to generate random alphanumeric passwords in PHP
> // It expects to be passed a desired password length, but it
> // none is passed the default is set to 8 (you can change this)
> function generate_password($length = 8) {
>
> // This variable contains the list of allowable characters
> // for the password. Note that the number 0 and the letter
> // 'O' have been removed to avoid confusion between the two.
> // The same is true of 'I' and 1
> $allowable_characters =
"abcdefghefghijklmnopqrstuvwxyz0123456789%#*&";
>
> // We see how many characters are in the allowable list
> $ps_len = strlen($allowable_characters);
>
> // Seed the random number generator with the microtime stamp
> // (current UNIX timestamp, but in microseconds)
> mt_srand((double)microtime()*1000000);
>
> // Declare the password as a blank string.
> $pass = "";
>
> // Loop the number of times specified by $length
> for($i = 0; $i < $length; $i++) {
>
> // Each iteration, pick a random character from the
> // allowable string and append it to the password.
> $pass .= $allowable_characters[mt_rand(0,$ps_len-1)];
>
> }
>
> // Retun the password we've selected
> return $pass;
> }
>
> $password = generate_password();
> echo $password;
>
> ?>
>
> --
> -----------------------------------------------------------------------
> Davy Obdam
> Web application developer
>
> Networking4all
> email: [EMAIL PROTECTED]
> email: [EMAIL PROTECTED]
> internet: http://www.networking4all.com
> -----------------------------------------------------------------------
>
>
>
--- End Message ---
--- Begin Message ---
Im trying to make calls to java classes and I keep getting class not found
errors... I got this idea from a tutorial. I have the extensions
uncommented as well in the PHP ini file.
my set up follows:
php.ini:
....
[Java]
java.class.path = C:\apache\php\JAVA\php_java.jar;c:\apache\htdocs\ktest\;.
java.home = C:\j2sdk1.4.1_01\bin\
java.library = C:\j2sdk1.4.1_01\jre\bin\server\jvm.dll
java.library.path = C:\apache\php\extensions\;C:\apache\php\;.\
the PHP source code:
<?
$myClass = new Java("java.io.file","c:\apache\logs\error.log");
if ($myClass->exists()) {
echo "File path is ".$myClass->getAbsolutePath()."<br/>";
} else {
echo "<br/> blah no workie <br/>";
}
?>
resulting output:
Warning: java.lang.ClassNotFoundException: java.io.file in
c:\apache\htdocs\ktest\xzerror.php on line 1
Fatal error: Call to a member function on a non-object in
c:\apache\htdocs\ktest\xzerror.php on line 2
anything obvious i am missing?
--
Kevin Ison
Charlotte, NC
704-576-5860
http://www.kevison.com
--- End Message ---
--- Begin Message ---
At 07:25 17.06.2003 -0400, Kevin Ison wrote:
Im trying to make calls to java classes and I keep getting class not found
errors... I got this idea from a tutorial. I have the extensions
uncommented as well in the PHP ini file.
my set up follows:
php.ini:
....
[Java]
java.class.path = C:\apache\php\JAVA\php_java.jar;c:\apache\htdocs\ktest\;.
java.home = C:\j2sdk1.4.1_01\bin\
java.library = C:\j2sdk1.4.1_01\jre\bin\server\jvm.dll
java.library.path = C:\apache\php\extensions\;C:\apache\php\;.\
ext/java configuration is a bit tricky, however something like the
following should work:
[Java]
java.class.path = c:\php\extensions\php_java.jar
java.home = c:\j2sdk1.4.1_01\jre
java.library = c:\j2sdk1.4.1_01\jre\bin\client\jvm.dll
java.library.path = c:\php\extensions\
the PHP source code:
<?
$myClass = new Java("java.io.file","c:\apache\logs\error.log");
if ($myClass->exists()) {
echo "File path is ".$myClass->getAbsolutePath()."<br/>";
} else {
echo "<br/> blah no workie <br/>";
}
?>
resulting output:
Warning: java.lang.ClassNotFoundException: java.io.file in
c:\apache\htdocs\ktest\xzerror.php on line 1
Fatal error: Call to a member function on a non-object in
c:\apache\htdocs\ktest\xzerror.php on line 2
anything obvious i am missing?
AFAIR java is case sensitive :)
try:
$myClass = new Java("java.io.File","c:\\apache\\logs\\error.log");
mit freundlichen grüßen aus berlin,
daniel
/*--
Daniel Beulshausen - [EMAIL PROTECTED]
Using PHP on Windows? http://www.php4win.com
--- End Message ---
--- Begin Message ---
hehehe that worked thank you!
amazing what correct syntax can do!
Danke!
"Daniel Beulshausen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
At 07:25 17.06.2003 -0400, Kevin Ison wrote:
>Im trying to make calls to java classes and I keep getting class not found
>errors... I got this idea from a tutorial. I have the extensions
>uncommented as well in the PHP ini file.
>
> my set up follows:
>
>php.ini:
>....
>[Java]
>java.class.path = C:\apache\php\JAVA\php_java.jar;c:\apache\htdocs\ktest\;.
>java.home = C:\j2sdk1.4.1_01\bin\
>java.library = C:\j2sdk1.4.1_01\jre\bin\server\jvm.dll
>java.library.path = C:\apache\php\extensions\;C:\apache\php\;.\
ext/java configuration is a bit tricky, however something like the
following should work:
[Java]
java.class.path = c:\php\extensions\php_java.jar
java.home = c:\j2sdk1.4.1_01\jre
java.library = c:\j2sdk1.4.1_01\jre\bin\client\jvm.dll
java.library.path = c:\php\extensions\
>the PHP source code:
><?
>$myClass = new Java("java.io.file","c:\apache\logs\error.log");
>if ($myClass->exists()) {
> echo "File path is ".$myClass->getAbsolutePath()."<br/>";
>} else {
> echo "<br/> blah no workie <br/>";
>}
>?>
>
>resulting output:
>Warning: java.lang.ClassNotFoundException: java.io.file in
>c:\apache\htdocs\ktest\xzerror.php on line 1
>Fatal error: Call to a member function on a non-object in
>c:\apache\htdocs\ktest\xzerror.php on line 2
>
>
>anything obvious i am missing?
AFAIR java is case sensitive :)
try:
$myClass = new Java("java.io.File","c:\\apache\\logs\\error.log");
mit freundlichen grüßen aus berlin,
daniel
/*--
Daniel Beulshausen - [EMAIL PROTECTED]
Using PHP on Windows? http://www.php4win.com
--- End Message ---
--- Begin Message ---
I have never used E_ALL, still I don't have lots of bugs in my PHP apps, and
when I get one, I track it down in secs anyway... Let me show you an example
of how my code looks like:
$exp=preg_replace(array("#(\+|\-)([a-z])#i","#(\+|\-)
#"),array("\\11\\2","\\1"),$exp);
echo $exp," = ";$s=split(" ",$exp);
for($i=0;$i<count($s);$i++){
$t=preg_replace("#(\+|\*|\-|/)?([0-9]+)([a-z]*)#ie","('\\3'?'\\3':'@').':::'
.chval('\\1','\\2',('\\3'),'\\3'?\$v['\\3']:\$v['@']);",$s[$i]);
$tmp=split(":{3}",$t);$v[$tmp[0]]=$tmp[1];
}$c=0;while(list($var,$val)=each($v))
{if($var=="@")$var="";
if($c)
{echo (($val>0)?"+$val":$val).$var;}
else{
echo $val.$var;
$c++;
}}
I'm at the age of 14... If I got no problem with tracking down bugs, not
many ppl can have...
About register_globals... I guess you're right... But still, how many things
change like that? I made one script in my entire life that wasn't exactly
what I expected it to be (was going to be a test for how to open and read
files, became an entire screenshots script with upload and descriptions
based on txt files, lol)... That was the first script I ever made... All the
others have followed their orginal purpose to 100%... And it's like the
manual states, turning on register_globals doesn't make all scripts safe...
Although, you didn't really say that neither but... Also, if he already have
the book, chances are that he bought it before 4.2.0...
Anyway, today is the last day I'm here to discuss this (going on a camp for
three weeks, no comp there)... So, post quickly or send me a mail in cc: or
something if you are going to reply, please...
// DvDmanDT
"Per Lundberg" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I tried a manual back button
<FORM>
<INPUT TYPE="button" VALUE="Back" onClick="history.go(-1)">
</FORM>
and also session_cache_limiter('private'); But none worked.
Ne other ideas.
Regards,
Harpreet
----- Original Message -----
From: "Stephen" <[EMAIL PROTECTED]>
To: "Harpreet" <[EMAIL PROTECTED]>
Cc: "Windows Helplist (PHP)" <[EMAIL PROTECTED]>
Sent: Monday, June 16, 2003 2:52 PM
Subject: Re: [PHP-WIN] Back button error
> Its a feature of IE. It stops you going backwards to a page which was
> generated when you sent form data to it. There is no way around this, so
you
> will need to find a way around your problem (A manual "<-- Go Back" link
> perhaps?)
>
> Stephen
>
> ----- Original Message -----
> From: "Harpreet" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, June 16, 2003 7:55 PM
> Subject: [PHP-WIN] Back button error
>
>
> > I am getting the following error when i use the IE back button.
> >
> > Warning: Page has Expired The page you requested was created using
> > information you submitted in a form. This page is no longer available.
As
> a
> > security precaution, Internet Explorer does not automatically resubmit
> your
> > information for you.
> >
> > To resubmit your information and view this Web page, click the Refresh
> > button.
> >
> > I read by writing the following it should work.
> > session_cache_limiter('private_no_expire');
> >
> > But no luck.
> > How do i change the headers to make my back button work.
> >
> > Please help.
> > Regards,
> > Harpreet
> >
> >
> >
> > --
> > 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 ---
Also the back button works for regular pages . It gives me the below error
only when i try to go back to a page that was an action to a form - a page
where a form is processed.
Warning: Page has Expired The page you requested was created using
information you submitted in a form. This page is no longer available. As a
security precaution, Internet Explorer does not automatically resubmit your
information for you.
To resubmit your information and view this Web page, click the Refresh
button.
Can i work around it. Please help.
Thanks,
Regards,
Harpreet
----- Original Message -----
From: "Harpreet" <[EMAIL PROTECTED]>
To: "Windows Helplist (PHP)" <[EMAIL PROTECTED]>
Sent: Tuesday, June 17, 2003 12:58 PM
Subject: Re: [PHP-WIN] Back button error
> I tried a manual back button
> <FORM>
>
> <INPUT TYPE="button" VALUE="Back" onClick="history.go(-1)">
>
> </FORM>
>
> and also session_cache_limiter('private'); But none worked.
>
> Ne other ideas.
>
> Regards,
> Harpreet
> ----- Original Message -----
> From: "Stephen" <[EMAIL PROTECTED]>
> To: "Harpreet" <[EMAIL PROTECTED]>
> Cc: "Windows Helplist (PHP)" <[EMAIL PROTECTED]>
> Sent: Monday, June 16, 2003 2:52 PM
> Subject: Re: [PHP-WIN] Back button error
>
>
> > Its a feature of IE. It stops you going backwards to a page which was
> > generated when you sent form data to it. There is no way around this, so
> you
> > will need to find a way around your problem (A manual "<-- Go Back" link
> > perhaps?)
> >
> > Stephen
> >
> > ----- Original Message -----
> > From: "Harpreet" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, June 16, 2003 7:55 PM
> > Subject: [PHP-WIN] Back button error
> >
> >
> > > I am getting the following error when i use the IE back button.
> > >
> > > Warning: Page has Expired The page you requested was created using
> > > information you submitted in a form. This page is no longer available.
> As
> > a
> > > security precaution, Internet Explorer does not automatically resubmit
> > your
> > > information for you.
> > >
> > > To resubmit your information and view this Web page, click the Refresh
> > > button.
> > >
> > > I read by writing the following it should work.
> > > session_cache_limiter('private_no_expire');
> > >
> > > But no luck.
> > > How do i change the headers to make my back button work.
> > >
> > > Please help.
> > > Regards,
> > > Harpreet
> > >
> > >
> > >
> > > --
> > > 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
> >
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
You misunderstood what I meant. As far as I know there is NO way to go back
to a page where a form was submitted to. By a back button, I meant something
like <a href="previouspage.php">Go Back</a>.
Alternatively, if you use a header( "location: newpage.php"), then the end
user never sees the post submit page. For example
form.php submits to action.php
action.php had a header( "Location: afterform.php" ) command at the end of
it (no output to the browser can be made on this page)
afterform.php outputs a "Thank you" message.
The end user will only see form.php and afterform.php and will be able to go
back and forward between the pages without any problems. More of a work
around than a solution...
Good Luck
Stephen
----- Original Message -----
From: "Harpreet" <[EMAIL PROTECTED]>
To: "Windows Helplist (PHP)" <[EMAIL PROTECTED]>
Sent: Tuesday, June 17, 2003 5:58 PM
Subject: Re: [PHP-WIN] Back button error
> I tried a manual back button
> <FORM>
>
> <INPUT TYPE="button" VALUE="Back" onClick="history.go(-1)">
>
> </FORM>
>
> and also session_cache_limiter('private'); But none worked.
>
> Ne other ideas.
>
> Regards,
> Harpreet
> ----- Original Message -----
> From: "Stephen" <[EMAIL PROTECTED]>
> To: "Harpreet" <[EMAIL PROTECTED]>
> Cc: "Windows Helplist (PHP)" <[EMAIL PROTECTED]>
> Sent: Monday, June 16, 2003 2:52 PM
> Subject: Re: [PHP-WIN] Back button error
>
>
> > Its a feature of IE. It stops you going backwards to a page which was
> > generated when you sent form data to it. There is no way around this, so
> you
> > will need to find a way around your problem (A manual "<-- Go Back" link
> > perhaps?)
> >
> > Stephen
> >
> > ----- Original Message -----
> > From: "Harpreet" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, June 16, 2003 7:55 PM
> > Subject: [PHP-WIN] Back button error
> >
> >
> > > I am getting the following error when i use the IE back button.
> > >
> > > Warning: Page has Expired The page you requested was created using
> > > information you submitted in a form. This page is no longer available.
> As
> > a
> > > security precaution, Internet Explorer does not automatically resubmit
> > your
> > > information for you.
> > >
> > > To resubmit your information and view this Web page, click the Refresh
> > > button.
> > >
> > > I read by writing the following it should work.
> > > session_cache_limiter('private_no_expire');
> > >
> > > But no luck.
> > > How do i change the headers to make my back button work.
> > >
> > > Please help.
> > > Regards,
> > > Harpreet
> > >
> > >
> > >
> > > --
> > > 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
> >
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
This is not an error, this is a security issue:
Your form has passed the form variable thru 'post' method and when you are
hitting back button or reloading with a JScript the history page you see the
message because the IE do not re-submit automatically the form because is a
security leak.
If you really don't want to see the message appearing you have to specify in
the form the "<post method='get' action='... >" and this will automatically
submit the form once again.
--
-------------------------------------------------
Cristian MARIN - Developer
InterAKT Online (www.interakt.ro)
Tel: +4021 312.53.12
Tel/Fax: +4021 312.51.91
[EMAIL PROTECTED]
"Harpreet" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Also the back button works for regular pages . It gives me the below error
> only when i try to go back to a page that was an action to a form - a
page
> where a form is processed.
>
> Warning: Page has Expired The page you requested was created using
> information you submitted in a form. This page is no longer available. As
a
> security precaution, Internet Explorer does not automatically resubmit
your
> information for you.
>
> To resubmit your information and view this Web page, click the Refresh
> button.
>
>
> Can i work around it. Please help.
>
> Thanks,
>
> Regards,
> Harpreet
>
> ----- Original Message -----
> From: "Harpreet" <[EMAIL PROTECTED]>
> To: "Windows Helplist (PHP)" <[EMAIL PROTECTED]>
> Sent: Tuesday, June 17, 2003 12:58 PM
> Subject: Re: [PHP-WIN] Back button error
>
>
> > I tried a manual back button
> > <FORM>
> >
> > <INPUT TYPE="button" VALUE="Back" onClick="history.go(-1)">
> >
> > </FORM>
> >
> > and also session_cache_limiter('private'); But none worked.
> >
> > Ne other ideas.
> >
> > Regards,
> > Harpreet
> > ----- Original Message -----
> > From: "Stephen" <[EMAIL PROTECTED]>
> > To: "Harpreet" <[EMAIL PROTECTED]>
> > Cc: "Windows Helplist (PHP)" <[EMAIL PROTECTED]>
> > Sent: Monday, June 16, 2003 2:52 PM
> > Subject: Re: [PHP-WIN] Back button error
> >
> >
> > > Its a feature of IE. It stops you going backwards to a page which was
> > > generated when you sent form data to it. There is no way around this,
so
> > you
> > > will need to find a way around your problem (A manual "<-- Go Back"
link
> > > perhaps?)
> > >
> > > Stephen
> > >
> > > ----- Original Message -----
> > > From: "Harpreet" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, June 16, 2003 7:55 PM
> > > Subject: [PHP-WIN] Back button error
> > >
> > >
> > > > I am getting the following error when i use the IE back button.
> > > >
> > > > Warning: Page has Expired The page you requested was created using
> > > > information you submitted in a form. This page is no longer
available.
> > As
> > > a
> > > > security precaution, Internet Explorer does not automatically
resubmit
> > > your
> > > > information for you.
> > > >
> > > > To resubmit your information and view this Web page, click the
Refresh
> > > > button.
> > > >
> > > > I read by writing the following it should work.
> > > > session_cache_limiter('private_no_expire');
> > > >
> > > > But no luck.
> > > > How do i change the headers to make my back button work.
> > > >
> > > > Please help.
> > > > Regards,
> > > > Harpreet
> > > >
> > > >
> > > >
> > > > --
> > > > 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
> > >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
--- End Message ---
--- Begin Message ---
Also you have to call all the form vars thru $HTTP_GET_VARS instead of
$HTTP_POST_VARS into the page which interpret the form's data.
The message you see is not an error is a security warning. Just like when
you are deleting files. If the user is sure he want the IE to resend the
data and reload the result page he simply hit the Refresh (Ctrl+R). If not,
it will move forward or backward with the IE buttons.
--
-------------------------------------------------
Cristian MARIN - Developer
InterAKT Online (www.interakt.ro)
Tel: +4021 312.53.12
Tel/Fax: +4021 312.51.91
[EMAIL PROTECTED]
"Cristian Marin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This is not an error, this is a security issue:
> Your form has passed the form variable thru 'post' method and when you are
> hitting back button or reloading with a JScript the history page you see
the
> message because the IE do not re-submit automatically the form because is
a
> security leak.
>
> If you really don't want to see the message appearing you have to specify
in
> the form the "<post method='get' action='... >" and this will
automatically
> submit the form once again.
>
> --
> -------------------------------------------------
> Cristian MARIN - Developer
> InterAKT Online (www.interakt.ro)
> Tel: +4021 312.53.12
> Tel/Fax: +4021 312.51.91
> [EMAIL PROTECTED]
> "Harpreet" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Also the back button works for regular pages . It gives me the below
error
> > only when i try to go back to a page that was an action to a form - a
> page
> > where a form is processed.
> >
> > Warning: Page has Expired The page you requested was created using
> > information you submitted in a form. This page is no longer available.
As
> a
> > security precaution, Internet Explorer does not automatically resubmit
> your
> > information for you.
> >
> > To resubmit your information and view this Web page, click the Refresh
> > button.
> >
> >
> > Can i work around it. Please help.
> >
> > Thanks,
> >
> > Regards,
> > Harpreet
> >
> > ----- Original Message -----
> > From: "Harpreet" <[EMAIL PROTECTED]>
> > To: "Windows Helplist (PHP)" <[EMAIL PROTECTED]>
> > Sent: Tuesday, June 17, 2003 12:58 PM
> > Subject: Re: [PHP-WIN] Back button error
> >
> >
> > > I tried a manual back button
> > > <FORM>
> > >
> > > <INPUT TYPE="button" VALUE="Back" onClick="history.go(-1)">
> > >
> > > </FORM>
> > >
> > > and also session_cache_limiter('private'); But none worked.
> > >
> > > Ne other ideas.
> > >
> > > Regards,
> > > Harpreet
> > > ----- Original Message -----
> > > From: "Stephen" <[EMAIL PROTECTED]>
> > > To: "Harpreet" <[EMAIL PROTECTED]>
> > > Cc: "Windows Helplist (PHP)" <[EMAIL PROTECTED]>
> > > Sent: Monday, June 16, 2003 2:52 PM
> > > Subject: Re: [PHP-WIN] Back button error
> > >
> > >
> > > > Its a feature of IE. It stops you going backwards to a page which
was
> > > > generated when you sent form data to it. There is no way around
this,
> so
> > > you
> > > > will need to find a way around your problem (A manual "<-- Go Back"
> link
> > > > perhaps?)
> > > >
> > > > Stephen
> > > >
> > > > ----- Original Message -----
> > > > From: "Harpreet" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Monday, June 16, 2003 7:55 PM
> > > > Subject: [PHP-WIN] Back button error
> > > >
> > > >
> > > > > I am getting the following error when i use the IE back button.
> > > > >
> > > > > Warning: Page has Expired The page you requested was created using
> > > > > information you submitted in a form. This page is no longer
> available.
> > > As
> > > > a
> > > > > security precaution, Internet Explorer does not automatically
> resubmit
> > > > your
> > > > > information for you.
> > > > >
> > > > > To resubmit your information and view this Web page, click the
> Refresh
> > > > > button.
> > > > >
> > > > > I read by writing the following it should work.
> > > > > session_cache_limiter('private_no_expire');
> > > > >
> > > > > But no luck.
> > > > > How do i change the headers to make my back button work.
> > > > >
> > > > > Please help.
> > > > > Regards,
> > > > > Harpreet
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > 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
> > > >
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
>
>
--- End Message ---
--- Begin Message ---
Create the authentication form which submit the page to a php ... there you
verify first if the user and password are ok then you make something like
this:
if ($username='ok' && $password='ok')
session_start();
session_register('username');
session_register('id_user');
}
after this in all protected pages you have to add in first line something
like this:
<?php
session_start();
if (!isset($HTTP_SESSION_VARS['username'])){
header("Location:login.php");
}
//the page code here
?>
You may even enter the session_start and if into a different page and on top
of every page to write :
<?php
require_once('verify_auth.php');
//the page code here
?>
and the user will be automatically redirected to the login page if is not
logged in.
If is not this the problem explain me what I have miss understood and I will
send you the exact code. Sorry, I don't have time to read all the messages
in this topic.
By
--
-------------------------------------------------
Cristian MARIN - Developer
InterAKT Online (www.interakt.ro)
Tel: +4021 312.53.12
Tel/Fax: +4021 312.51.91
[EMAIL PROTECTED]
"Guru P Chaturvedi" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi Neil,
>
> Well is it basically to collect user name and password from user? What
> actually i am looking for is skipping this screen and having the same
> functionality thru a HTML form.
>
> Lemme explain you in details... I have a set of files protected using the
> Auth Directives. So user's need to provide user name and password to
access
> these files via browser. Now what i am looking at is using HTML form to
> login like Yahoo! or MSN... but users who login using this method only
> should be able to access files. Are there any ways of doing this... please
> help me out in this regard.
>
> Thanks in advance,
> Guru.
>
> "Neil Smith" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Try this. Please note that on windows you *cannot* raise a http auth box
> > this way (PHP_AUTH_USER is not defined for Apache on windows), so you
will
> > need to use this on your live unix Apache/PHP server :
> >
> > function getUserAuthPW() {
> > // If present, set user Authenticate Password box values
> > global $_SERVER;
> > if (isset($_SERVER["PHP_AUTH_USER"])) {
> >
$username=safestring($_SERVER["PHP_AUTH_USER"]);
> > $password=safestring($_SERVER["PHP_AUTH_PW"]);
> > return true;
> > } else {
> > header("WWW-Authenticate: Basic
> > realm=\"CaptionKit\"");
> > header("HTTP/1.0 401 Unauthorized");
> > echo "You must enter a valid login ID and
> password
> > to access this resource\n";
> > exit;
> > }
> > }
> >
> > What this does is to check for PHP_AUTH_USER and if it's not defined,
> > raises a 401 error. The client interprets this as a request to enter
user
> > name & password, and brings up the grey box you see using .htaccess /
> > .htpasswd files. The function safestring just adds slashes if there
are
> > characters which need escaping for your database (some people might just
> > 'addslashes()' but I do a little more first, like trim and
> htmlspecialchars).
> >
> > Cheers - Neil Smith.
> >
> > Please note : I do not accept email from hotmail, yahoo, AOL or msn
> > accounts. All such mail *will* be bounced and deleted without being
read.
> > Thankyou for your understanding.
> >
> > At 07:36 16/06/2003 +0000, you wrote:
> > >Message-ID: <[EMAIL PROTECTED]>
> > >To: [EMAIL PROTECTED]
> > >Reply-To: "Guru P Chaturvedi" <[EMAIL PROTECTED]>
> > >From: "Guru P Chaturvedi" <[EMAIL PROTECTED]>
> > >Date: Mon, 16 Jun 2003 01:16:53 +0530
> > >Subject: Re: User Authentication...
> > >MIME-Version: 1.0
> > >
> > >Hi,
> > >
> > >Any clues...please?!
> >
>
>
--- End Message ---
--- Begin Message ---
Hi Cristian,
Well what wanted to tell u is all the files that i wanna secure are kind of
Word Documents, PDFs, .EXEs which users can access. If i use .htaccess files
it works fine. But i want to provide a HTML login form. can u now explain me
how i can go about... ?
Regards,
Guru.
"Cristian Marin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Create the authentication form which submit the page to a php ... there
you
> verify first if the user and password are ok then you make something like
> this:
>
> if ($username='ok' && $password='ok')
> session_start();
> session_register('username');
> session_register('id_user');
> }
>
> after this in all protected pages you have to add in first line something
> like this:
> <?php
>
> session_start();
> if (!isset($HTTP_SESSION_VARS['username'])){
> header("Location:login.php");
> }
>
> //the page code here
>
> ?>
> You may even enter the session_start and if into a different page and on
top
> of every page to write :
> <?php
> require_once('verify_auth.php');
>
> //the page code here
>
> ?>
> and the user will be automatically redirected to the login page if is not
> logged in.
>
> If is not this the problem explain me what I have miss understood and I
will
> send you the exact code. Sorry, I don't have time to read all the messages
> in this topic.
>
> By
>
> --
> -------------------------------------------------
> Cristian MARIN - Developer
> InterAKT Online (www.interakt.ro)
> Tel: +4021 312.53.12
> Tel/Fax: +4021 312.51.91
> [EMAIL PROTECTED]
> "Guru P Chaturvedi" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi Neil,
> >
> > Well is it basically to collect user name and password from user? What
> > actually i am looking for is skipping this screen and having the same
> > functionality thru a HTML form.
> >
> > Lemme explain you in details... I have a set of files protected using
the
> > Auth Directives. So user's need to provide user name and password to
> access
> > these files via browser. Now what i am looking at is using HTML form to
> > login like Yahoo! or MSN... but users who login using this method only
> > should be able to access files. Are there any ways of doing this...
please
> > help me out in this regard.
> >
> > Thanks in advance,
> > Guru.
> >
> > "Neil Smith" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Try this. Please note that on windows you *cannot* raise a http auth
box
> > > this way (PHP_AUTH_USER is not defined for Apache on windows), so you
> will
> > > need to use this on your live unix Apache/PHP server :
> > >
> > > function getUserAuthPW() {
> > > // If present, set user Authenticate Password box values
> > > global $_SERVER;
> > > if (isset($_SERVER["PHP_AUTH_USER"])) {
> > >
> $username=safestring($_SERVER["PHP_AUTH_USER"]);
> > >
$password=safestring($_SERVER["PHP_AUTH_PW"]);
> > > return true;
> > > } else {
> > > header("WWW-Authenticate: Basic
> > > realm=\"CaptionKit\"");
> > > header("HTTP/1.0 401 Unauthorized");
> > > echo "You must enter a valid login ID and
> > password
> > > to access this resource\n";
> > > exit;
> > > }
> > > }
> > >
> > > What this does is to check for PHP_AUTH_USER and if it's not defined,
> > > raises a 401 error. The client interprets this as a request to enter
> user
> > > name & password, and brings up the grey box you see using .htaccess /
> > > .htpasswd files. The function safestring just adds slashes if there
> are
> > > characters which need escaping for your database (some people might
just
> > > 'addslashes()' but I do a little more first, like trim and
> > htmlspecialchars).
> > >
> > > Cheers - Neil Smith.
> > >
> > > Please note : I do not accept email from hotmail, yahoo, AOL or msn
> > > accounts. All such mail *will* be bounced and deleted without being
> read.
> > > Thankyou for your understanding.
> > >
> > > At 07:36 16/06/2003 +0000, you wrote:
> > > >Message-ID: <[EMAIL PROTECTED]>
> > > >To: [EMAIL PROTECTED]
> > > >Reply-To: "Guru P Chaturvedi" <[EMAIL PROTECTED]>
> > > >From: "Guru P Chaturvedi" <[EMAIL PROTECTED]>
> > > >Date: Mon, 16 Jun 2003 01:16:53 +0530
> > > >Subject: Re: User Authentication...
> > > >MIME-Version: 1.0
> > > >
> > > >Hi,
> > > >
> > > >Any clues...please?!
> > >
> >
> >
>
>
--- End Message ---
--- Begin Message ---
Hi,
i tried installing mysql-4.1.0-alpha, apache, php4.3.2. now the issue is
that i have all the 3 application running and interacting with each other in
sync ....but every time i try to connect to mysql through php it gives me
this error:
Warning: mysql_connect(): Client does not support authentication protocol
requested by server. Consider upgrading MySQL client
this is the 1st time i am trying to set up a server i will really appreciate
your help....thanks
--anand
--- End Message ---