php-windows Digest 18 Jun 2003 12:15:46 -0000 Issue 1782
Topics (messages 20394 through 20406):
Re: problems with variables
20394 by: Felipe Lorente
Re: Subject: Re: User Authentication...
20395 by: Neil Smith
20401 by: Cristian MARIN
20405 by: Guru P Chaturvedi
MySQL Connection
20396 by: moses.johnson.btopenworld.com
20398 by: Anthony M. Saffer
Re: [PHP-DB] MySQL Connection
20397 by: John W. Holmes
php and mysql with horde
20399 by: josh aldrich
Re: Password generator
20400 by: Svensson, B.A.T. (HKG)
Session variables lost
20402 by: Reuven Nisser
Installation php on Windows 2003 and IIS 6
20403 by: Martin Rytz
20404 by: Alain Kumschick
InnoDB, ACID and Transactions...
20406 by: Guru P Chaturvedi
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 ---
Ok, thanks, now it is working!!
"Sven" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> your vars you want to send to your next page are stored in these arrays.
>
> so if you POSTed a form with $name and $email use $_POST['name'] or
> $HTTP_POST_VARS['email'] in your script instead of the awaited $name and
> $email.
>
> ciao SVEN
>
>
> "Felipe Lorente" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
> >
> > Thanks, but where should I use $HTTP_XXXX_VARS['varname'] Arrays??
> >
> > Thanks again.
> >
> > Felipe.
> >
> > "Malte" <[EMAIL PROTECTED]> escribió en el mensaje
> > news:[EMAIL PROTECTED]
> > > you probably got register globals turned off in your php.ini file.
Turn
> it
> > > on or use the
> > > $HTTP_XXXX_VARS['varname'] Arrays
> > >
> > > XXXX can be POST, GET, SESSION and so on
> > >
> > > malte
> > >
> > > ----- Original Message -----
> > > From: "Felipe Lorente" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Sunday, June 15, 2003 7:57 PM
> > > Subject: [PHP-WIN] problems with variables
> > >
> > >
> > > > Hello all,
> > > >
> > > > I just have installed php 4.3.2, and it runs fine with single
files.
> > The
> > > > problem comes when I try to pass a variable from another file, it
> > doesn`t
> > > > recognise this variable. I am using IIS 5.1 with Win XP and I have
> used
> > > the
> > > > windows instaler to install the sources on my machine. Does anyone
> know
> > > what
> > > > can happen?? Thanks.
> > > >
> > > > Felipe.
> > > >
> > > >
> > > >
> > > > --
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > >
> >
> >
>
>
--- End Message ---
--- Begin Message ---
Well what I would probably do is this :
Store the users authenticated directory name in a session from the login form.
Add a mod_rewrite directive to the top level users directory which
redirects to a PHP script on attempted direct access to the specified
directories.
Use this PHP script to determine if the users session authentication is
appropriate for the directory they are trying to access (usually, I would
authenticate against encrypted passwords in a database).
If its acceptable, do readdir() from PHP and present an on screen list of
files, routed through to another PHP file which actually *delivers* those
files to the user when they click on the file names you just read.
Of course, it depends on the types of files you plan on sending, and how
deep your directory structure is, exactly how you do this : To maintain
consistency, you will need to send the correct mime-type header when a user
clicks a file name , then use readfile() to pass them the file data through
from PHP.
I still don't know what web server you are using, or even if you plan on
using PHP, though ASP can do some of the same things through its filesystem
objects as can perl, ColdFusion etc.
Hope that helps, if not, I can program this sort of solution at very
reasonable rates ;-))
Cheers - Neil.
At 08:35 17/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: Tue, 17 Jun 2003 13:19:45 +0530
Subject: Re: Subject: Re: User Authentication...
MIME-Version: 1.0
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 ---
I think you want the user to browse thru the directories and download a
file.
In this case the only way I see this resolving is to make your own index
list of files. You can create a index.php in every directory the user can
see in which you can do something like:
<?php
require_once('/auth_user.php');
// About the auth_user.php I discused in the earlier post
$path_back="../";
function getFileList(){
...
return $fileList;
}
$files=getFileList();
echo "<a href='".$path_back."'>..</a>"
for ($i=0; $i<sizeof($files);$i++){
echo <a href='".$files[$i]."'>".$files[$i]."</a><br>"
}
?>
Torn the navigation thru directories off.
The only impediment is the fact that you cannot restrict this way the user
to access directly a file if he already getted once.
If you really want to do that you may try this approach but instead of
scanning the files in the directory to have the files, keep the files else
where and submit the links when the user try to download one to another php
file which get them for you if the user was authenticated. The getter should
look like this:
<?php
require_once("/auth_user.php");
function getRealPath($theRelativePath){
return "../a_new_path_added_to_relative_path".$theRelativePath;
}
if(isset($HTTP_GET_VARS['path'])){
header("Location:".getRealPath($HTTP_GET_VARS['path']));
}else{
header("Location:/index.php");
}
?>
Hope this helps
--
-------------------------------------------------
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 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,
What if the user tries to download the file thru DAP or any other download
tool? Can we restric even that...?
Regards,
Guru.
===============================
"Cristian Marin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I think you want the user to browse thru the directories and download a
> file.
> In this case the only way I see this resolving is to make your own index
> list of files. You can create a index.php in every directory the user can
> see in which you can do something like:
>
> <?php
> require_once('/auth_user.php');
> // About the auth_user.php I discused in the earlier post
> $path_back="../";
>
> function getFileList(){
> ...
> return $fileList;
> }
>
> $files=getFileList();
>
> echo "<a href='".$path_back."'>..</a>"
>
> for ($i=0; $i<sizeof($files);$i++){
> echo <a href='".$files[$i]."'>".$files[$i]."</a><br>"
> }
>
> ?>
> Torn the navigation thru directories off.
> The only impediment is the fact that you cannot restrict this way the user
> to access directly a file if he already getted once.
>
> If you really want to do that you may try this approach but instead of
> scanning the files in the directory to have the files, keep the files else
> where and submit the links when the user try to download one to another
php
> file which get them for you if the user was authenticated. The getter
should
> look like this:
>
> <?php
> require_once("/auth_user.php");
>
> function getRealPath($theRelativePath){
> return "../a_new_path_added_to_relative_path".$theRelativePath;
> }
> if(isset($HTTP_GET_VARS['path'])){
> header("Location:".getRealPath($HTTP_GET_VARS['path']));
> }else{
> header("Location:/index.php");
> }
> ?>
>
> Hope this helps
> --
> -------------------------------------------------
> 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 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 ---
Hello,
Would be grateful if someone couldkindly point me in the right direction.
Whenever I try to connect to mysql server, I get these messsage back
1.
mysql> GRANT ALL PRIVILEGES ON *.* TO moses@"%" IDENTIFIED BY "cludiana";
ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
mysql>
2.
mysql> GRANT ALL PRIVILEGES ON *.* TO moses@"%" IDENTIFIED BY "cludiana";
ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
mysql>
what could be wrong. Help please .
Regards
Moses
--- End Message ---
--- Begin Message ---
This is message (not generated by or associated with PHP at all) that is telling you
that your users (probably supposed to be root) doesn't have the right to perform the
action you're trying to do. If you're trying to administer MySQL from the console try
typing this:
mysql --user=root mysql
This will start the mysql admin program for the root user (which shouldn't have a
password yet) and select the mysql database. The mysql database contains all of your
user information. You should then be able to perform your grants. Check out
http://www.mysql.com/doc/en/Adding_users.html for more information on adding new users
to MySQL.
HTH,
Anthony Saffer,
Founder & Owner
www.safferconsulting.com
Authorized MySQL Partner!
P: (918) 542-8251
E: [EMAIL PROTECTED]
ICQ: 96698595
Yahoo: scs_anthonysaffer
----- Original Message -----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, June 17, 2003 7:16 PM
Subject: [PHP-WIN] MySQL Connection
Hello,
Would be grateful if someone couldkindly point me in the right direction.
Whenever I try to connect to mysql server, I get these messsage back
1.
mysql> GRANT ALL PRIVILEGES ON *.* TO moses@"%" IDENTIFIED BY "cludiana";
ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
mysql>
2.
mysql> GRANT ALL PRIVILEGES ON *.* TO moses@"%" IDENTIFIED BY "cludiana";
ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
mysql>
what could be wrong. Help please .
Regards
Moses
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
Would be grateful if someone couldkindly point me in the right direction.
Whenever I try to connect to mysql server, I get these messsage back
1.
mysql> GRANT ALL PRIVILEGES ON *.* TO moses@"%" IDENTIFIED BY "cludiana";
ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
mysql>
2.
mysql> GRANT ALL PRIVILEGES ON *.* TO moses@"%" IDENTIFIED BY "cludiana";
ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
mysql>
what could be wrong. Help please .
1. This has nothing to do with PHP.
2. The user you connected to PHP with does not have permission to GRANT
privileges.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Anybody know how to add users the sql database so people can log in??
--- End Message ---
--- Begin Message ---
Create a string which is six char long,
(for instance shop the head and tail
of the first string if you are not able
to generate a six char string)
If you chop an 8 char string and MUST have
the special chars in the string then check
that the chopped char's is not a memember of
the special char's- If they are, regenerate a
new string an loop until they are not
Finally randomize the head and the tail with
you "custom" algorithm. E.g. an algoritm that
does not contain your
Med vanliga halsningar fran Amsterdam. =) ;)
-----Original Message-----
From: Davy Obdam
To: PHP; PHP-WIN; PHP-DB
Sent: 2003-06-17 11:45
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 ---
Hello,
I am using session variables using the format of $_SESSION["XXX"].
Sometimes, some of the session variables are lost when trying to access a
different page. The list is consistent. At the end of the current page, I
display the session variable value and it's working but on the start of the
next page it's gone.
I've seen some information about it saying to add page_start() and
page_end() using phplib. I do not know where to find phplib and I prefer not
to use plain php.
Any idea, someone?
Regards, Reuven
--- End Message ---
--- Begin Message ---
Hi there
There is a wonderfull installation guide for php on windows 2000
(http://www.atlguide2000.com/programming/index.php?act=view&aid=115). This
guide works very well for Windows 2000. I use now Windows 2003 and the
installation-procedure does no longer work :( it seems to be changed? Why
does it no longer work? Is there a new installation-guide for windows 2003?
What exactly has changed with the manual installation?
Kind Regards, Martin Rytz
--- End Message ---
--- Begin Message ---
you don't need the "installation-procedure".
download the php.zip it's about 9mb i think.
extract everything in the right folder.
(c:\php) and the dlls in (c:\windows\system32)
ones you configured php.ini in (c:\windows) open
IIS.
then go to "Web Service Extension" and add an
extension.
you'll need to browse for 2 files. first one:
c:\php\php.exe and the second one:
c:\php\php4ts.dll
both files MUST be "allowed".
then right click "Web Sites" and select "properties"
from the list. click on "configuration..." on the
"home directory" tab.
add your extensions you want to use.
exemple:
.php > c:\php\php.exe > all
.php3 > c:\php\php.exe > all
.phtml > c:\php\php.exe > all
close and that's it!
alain
"Martin Rytz" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there
>
> There is a wonderfull installation guide for php on windows 2000
> (http://www.atlguide2000.com/programming/index.php?act=view&aid=115). This
> guide works very well for Windows 2000. I use now Windows 2003 and the
> installation-procedure does no longer work :( it seems to be changed? Why
> does it no longer work? Is there a new installation-guide for windows
2003?
> What exactly has changed with the manual installation?
>
> Kind Regards, Martin Rytz
>
>
--- End Message ---
--- Begin Message ---
Hi,
I read about the InnoDB Tables. The most efficient kind of tables in MySQL.
But i wonder if we can manage transactions with these tables in PHP. Are
there any methods for this? To start, rollback and commit a transaction made
to InnoDB Table?
Please share, if guys have any info...:-)
--
with Warm Regards,
Guru.
---------------------------------------
Yahoo IM: guru4vedi
MSN: [EMAIL PROTECTED]
---------------------------------------
--- End Message ---