hi
I'm a Dreamweaver user who's created a few simple data entry/
registrations forms in my time, but I'm not really a coder (though I
can follow instructions and am not afraid to dabble...) - I generally
make use of DW's builtin commands and some extensions.
Anyway I'm creating a registration site for event exhibitors and I've
been asked to come up with a method of automatically generating
passwords for inserted records, either as they're inserted or at some
point later (i.e. some kind of mass password creation). Is there a
recognised way of populating multiple records' password fields with
random passwords (say 8 characters long)?
A couple of possible complications...
1. The client wants to be able to insert the rest of the exhibitor
data via a CSV upload (I'm using a Dreamweaver extension for this - http://www.felixone.it/extensions/prod/mxiecsven.asp) as well as
creating individual records manually via the registration site.
2. They've also asked that the password avoids letter 'O' and numner
'0'.
Thanks in advance! 7 2240
wozza wrote:
hi
I'm a Dreamweaver user who's created a few simple data entry/
registrations forms in my time, but I'm not really a coder (though I
can follow instructions and am not afraid to dabble...) - I generally
make use of DW's builtin commands and some extensions.
Anyway I'm creating a registration site for event exhibitors and I've
been asked to come up with a method of automatically generating
passwords for inserted records, either as they're inserted or at some
point later (i.e. some kind of mass password creation). Is there a
recognised way of populating multiple records' password fields with
random passwords (say 8 characters long)?
A couple of possible complications...
1. The client wants to be able to insert the rest of the exhibitor
data via a CSV upload (I'm using a Dreamweaver extension for this - http://www.felixone.it/extensions/prod/mxiecsven.asp) as well as
creating individual records manually via the registration site.
2. They've also asked that the password avoids letter 'O' and numner
'0'.
Thanks in advance!
No standard way, but lots of different ways to generate passwords. Try
googling for
"password generator" php
You'll get lots of ideas.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
On 25 Sep, 13:27, wozza <warren...@googlemail.comwrote:
hi
I'm a Dreamweaver user who's created a few simple data entry/
registrations forms in my time, but I'm not really a coder (though I
can follow instructions and am not afraid to dabble...) - I generally
make use of DW's builtin commands and some extensions.
Anyway I'm creating a registration site for event exhibitors and I've
been asked to come up with a method of automatically generating
passwords for inserted records, either as they're inserted or at some
point later (i.e. some kind of mass password creation). Is there a
recognised way of populating multiple records' password fields with
random passwords (say 8 characters long)?
A couple of possible complications...
1. The client wants to be able to insert the rest of the exhibitor
data via a CSV upload (I'm using a Dreamweaver extension for this -http://www.felixone.it/extensions/prod/mxiecsven.asp) as well as
creating individual records manually via the registration site.
2. They've also asked that the password avoids letter 'O' and numner
'0'.
Thanks in advance!
So you want to generate random passwords without the letter 0/number 0
A simple solution would be to generate a hash of the data along with a
secret salt - say
$password=str_replace('0', 'g', substr(sha1($data . 's3cr3t'),
0,8)); // sha1 is hex encoded i.e. 0-9,a-f
Or if you want a more random solution with more emphasis on
letters....
$chars=explode(',',"a,b,c,d,e,f,g,h,i,j,k,m,n,p,q, r,t,u,x,y,z,
2,3,4,5,6,7,8,9,!,$,%,&,*,@,#"); // for niceness I've also omitted l
(L) and 1 (one)
shuffle($chars);
$password=substr($chars,0,8);
C.
Message-ID:
<3a**********************************@l43g2000hsh. googlegroups.comfrom
wozza contained the following:
>Anyway I'm creating a registration site for event exhibitors and I've been asked to come up with a method of automatically generating passwords for inserted records, either as they're inserted or at some point later (i.e. some kind of mass password creation). Is there a recognised way of populating multiple records' password fields with random passwords (say 8 characters long)?
A couple of possible complications...
1. The client wants to be able to insert the rest of the exhibitor data via a CSV upload (I'm using a Dreamweaver extension for this - http://www.felixone.it/extensions/prod/mxiecsven.asp) as well as creating individual records manually via the registration site.
2. They've also asked that the password avoids letter 'O' and numner '0'.
What you are asking is not a major task for a coder and that's the
problem with DW generated code isn't it? You are fine until you want
something a bit different. In this case you may be better off paying
for an hour or so of a coder's time.
For the passwords, there are any number of scripts you could use. I
like to use a randomly chosen keyword (taken from a pool that I create
to suit the website) plus a randomly generated number between 0001 and
9999. This is reasonably secure as well as being fairly human friendly.
It's a good idea to make sure the username is unique, that way the
password need not be.
Here's the function I use, here with words which suit a financial theme
<?php
function passgen(){
$words=array("business","entrepreneur","economy"," bank","finance","money","shares","incubate","credi t","invoice","director","efficient","workplace","o ffice",
"sales","projection");
$key=array_rand($words);
$num=rand(1,9999);
$password=$words[$key].$num;
return $password;
}
echo passgen();
?>
See http://4theweb.co.uk/test/test.php
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011 http://slipperyhill.co.uk - http://4theweb.co.uk
wozza wrote:
hi
I'm a Dreamweaver user who's created a few simple data entry/
registrations forms in my time, but I'm not really a coder (though I
can follow instructions and am not afraid to dabble...) - I generally
make use of DW's builtin commands and some extensions.
Anyway I'm creating a registration site for event exhibitors and I've
been asked to come up with a method of automatically generating
passwords for inserted records, either as they're inserted or at some
point later (i.e. some kind of mass password creation). Is there a
recognised way of populating multiple records' password fields with
random passwords (say 8 characters long)?
A couple of possible complications...
1. The client wants to be able to insert the rest of the exhibitor
data via a CSV upload (I'm using a Dreamweaver extension for this - http://www.felixone.it/extensions/prod/mxiecsven.asp) as well as
creating individual records manually via the registration site.
2. They've also asked that the password avoids letter 'O' and numner
'0'.
Thanks in advance!
There's no standard way as it's pretty trivial to write a function to
generate random strings. This is what I use...
function rseq($x)
{
# Returns string of random alphanumeric characters of specified
length $x
# Note - mtrand (mersenne twister) used as rand not actually very
random at all!
$d = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW XYZ0123456789";
$dl = strlen($d)-1;
$s = '';
for($i = 0; $i < $x; $i++)
{
$s .= $d[(mt_rand(0,$dl))];
}
return $s;
}
Just lose the O's and 0's from $d. Do also note that this uses mt_rand
as PHP's normal random number generator is REALLY REALLY AWFUL.
Not sure what you mean when you say 'insert the rest of the exhibitor
data via a CSV upload'... What do they have and what do they want you to
do with it?
Regards,
Roger.
On 25 Sep, 14:03, "C. (http://symcbean.blogspot.com/)"
<colin.mckin...@gmail.comwrote:
On 25 Sep, 13:27, wozza <warren...@googlemail.comwrote:
hi
I'm a Dreamweaver user who's created a few simple data entry/
registrations forms in my time, but I'm not really a coder (though I
can follow instructions and am not afraid to dabble...) - I generally
make use of DW's builtin commands and some extensions.
Anyway I'm creating a registration site for event exhibitors and I've
been asked to come up with a method of automatically generating
passwords for inserted records, either as they're inserted or at some
point later (i.e. some kind of mass password creation). Is there a
recognised way of populating multiple records' password fields with
random passwords (say 8 characters long)?
A couple of possible complications...
1. The client wants to be able to insert the rest of the exhibitor
data via a CSV upload (I'm using a Dreamweaver extension for this -http://www.felixone.it/extensions/prod/mxiecsven.asp) as well as
creating individual records manually via the registration site.
2. They've also asked that the password avoids letter 'O' and numner
'0'.
Thanks in advance!
So you want to generate random passwords without the letter 0/number 0
A simple solution would be to generate a hash of the data along with a
secret salt - say
$password=str_replace('0', 'g', substr(sha1($data . 's3cr3t'),
0,8)); // sha1 is hex encoded i.e. 0-9,a-f
Or if you want a more random solution with more emphasis on
letters....
$chars=explode(',',"a,b,c,d,e,f,g,h,i,j,k,m,n,p,q, r,t,u,x,y,z,
2,3,4,5,6,7,8,9,!,$,%,&,*,@,#"); // for niceness I've also omitted l
(L) and 1 (one)
shuffle($chars);
$password=substr($chars,0,8);
C.
Whoops - last line should be
$password=substr(implode('',$chars),0,8);
C.
On 26 Sep, 07:01, r0g <aioe....@technicalbloke.comwrote:
wozza wrote:
hi
I'm a Dreamweaver user who's created a few simple data entry/
registrations forms in my time, but I'm not really a coder (though I
can follow instructions and am not afraid to dabble...) - I generally
make use of DW's builtin commands and some extensions.
Anyway I'm creating a registration site for event exhibitors and I've
been asked to come up with a method of automatically generating
passwords for inserted records, either as they're inserted or at some
point later (i.e. some kind of mass password creation). Is there a
recognised way of populating multiple records' password fields with
random passwords (say 8 characters long)?
A couple of possible complications...
1. The client wants to be able to insert the rest of the exhibitor
data via a CSV upload (I'm using a Dreamweaver extension for this - http://www.felixone.it/extensions/prod/mxiecsven.asp) as well as
creating individual records manually via the registration site.
2. They've also asked that the password avoids letter 'O' and numner
'0'.
Thanks in advance!
There's no standard way as it's pretty trivial to write a function to
generate random strings. This is what I use...
* function rseq($x)
* * {
* * * # Returns string of random alphanumeric characters of specified
length $x
* * * # Note - mtrand (mersenne twister) used as rand not actually very
random at all!
* * * $d = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW XYZ0123456789";
* * * $dl = strlen($d)-1;
* * * $s = '';
* * * for($i = 0; $i < $x; $i++)
* * * * {
* * * * * $s .= $d[(mt_rand(0,$dl))];
* * * * }
* * * return $s;
* * }
Just lose the O's and 0's from $d. Do also note that this uses mt_rand
as PHP's normal random number generator is REALLY REALLY AWFUL.
Not sure what you mean when you say 'insert the rest of the exhibitor
data via a CSV upload'... What do they have and what do they want you to
do with it?
Regards,
Roger.- Hide quoted text -
- Show quoted text -
Thanks for the replies guys. I've now decided to go a differetn route
in add the passwords to the records. Basically after inserting the
contents of a CSV (via that 3rd party extension for Dreamweaver I
mentioned) the browser is redirected to a php with the following
code:
<?php require_once('../Connections/connExhibiting.php'); ?>
<?php
mysql_select_db($database_connExhibiting, $connExhibiting) or
die(mysql_error());
function genRandomString() {
$length = 8;
$characters = "123456789abcdefghijklmnpqrstuvwxyz";
for ($p = 0; $p < $length; $p++) {
$string .= $characters[mt_rand(0, strlen($characters))];
}
return $string;
}
$query = "SELECT ID, password FROM tblUsers";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_assoc($result)) {
$id = $row['ID'];
$password = $row['password'];
$genPassword = genRandomString();
$sql_update = "UPDATE tblUsers SET password = '$genPassword' WHERE
(password = '' OR password is NULL)";
mysql_query($sql_update) or die(mysql_error());
}
?>
<?php
mysql_free_result($result);
?>
It _almost_ works, except the password is the same for all records - I
need the string returned by genRandomString() to be different for each
record - any help would be appreciated!
Cheers
On Sep 26, 7:01*am, r0g <aioe....@technicalbloke.comwrote:
wozza wrote:
hi
I'm a Dreamweaver user who's created a few simple data entry/
registrations forms in my time, but I'm not really a coder (though I
can follow instructions and am not afraid to dabble...) - I generally
make use of DW's builtin commands and some extensions.
Anyway I'm creating a registration site for event exhibitors and I've
been asked to come up with a method of automatically generating
passwords for inserted records, either as they're inserted or at some
point later (i.e. some kind of mass password creation). Is there a
recognised way of populating multiple records' password fields with
random passwords (say 8 characters long)?
A couple of possible complications...
1. The client wants to be able to insert the rest of the exhibitor
data via a CSV upload (I'm using a Dreamweaver extension for this - http://www.felixone.it/extensions/prod/mxiecsven.asp) as well as
creating individual records manually via the registration site.
2. They've also asked that the password avoids letter 'O' and numner
'0'.
Thanks in advance!
There's no standard way as it's pretty trivial to write a function to
generate random strings. This is what I use...
* function rseq($x)
* * {
* * * # Returns string of random alphanumeric characters of specified
length $x
* * * # Note - mtrand (mersenne twister) used as rand not actually very
random at all!
* * * $d = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW XYZ0123456789";
* * * $dl = strlen($d)-1;
* * * $s = '';
* * * for($i = 0; $i < $x; $i++)
* * * * {
* * * * * $s .= $d[(mt_rand(0,$dl))];
* * * * }
* * * return $s;
* * }
Just lose the O's and 0's from $d. Do also note that this uses mt_rand
as PHP's normal random number generator is REALLY REALLY AWFUL.
Not sure what you mean when you say 'insert the rest of the exhibitor
data via a CSV upload'... What do they have and what do they want you to
do with it?
Regards,
Roger.- Hide quoted text -
- Show quoted text -
Thanks for the replies guys. I've now decided to go a differetn route
in add the passwords to the records. Basically after inserting the
contents of a CSV (via that 3rd party extension for Dreamweaver I
mentioned) the browser is redirected to a php with the following
code:
<?php require_once('../Connections/connExhibiting.php'); ?>
<?php
mysql_select_db($database_connExhibiting, $connExhibiting) or
die(mysql_error());
function genRandomString() {
$length = 8;
$characters = "123456789abcdefghijklmnpqrstuvwxyz";
for ($p = 0; $p < $length; $p++) {
$string .= $characters[mt_rand(0, strlen($characters))];
}
return $string;
}
$query = "SELECT ID, password FROM tblUsers";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_assoc($result)) {
$genPassword = genRandomString();
$sql_update = "UPDATE tblUsers SET password = '$genPassword'
WHERE
(password = '' OR password is NULL)";
mysql_query($sql_update) or die(mysql_error());
}
?>
<?php
mysql_free_result($result);
?>
It _almost_ works, except the password is the same for all records -
I
need the string returned by genRandomString() to be different for
each
record - any help would be appreciated!
Cheers This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Gleep |
last post by:
sorry i didn't explain it correctly before
my table is like this
example fields:
ID name username outcome date1 date2 date3 (etc..) - date15 price1 price2 price3 (etc..)
I know that...
|
by: Dave Smithz |
last post by:
Hello there,
In summary: How to make my password protected php scripts available for use
to public, without letting them do anything they want to DB.
Previously a shared hosting hosted MySQL...
|
by: Andrew DeFaria |
last post by:
I am developing a database application in which I store usernames and
passwords. Naturally I want to store the passwords in an encrypted form.
However, just like you see in many web applications, I...
|
by: news |
last post by:
This is a tough question to ask.
I need to pull up a report of all the orders in our e-commerce site,
that has more than one item attributed to it.
orders.ordernum, orderitems.itemnumber...
|
by: daniellee2006 |
last post by:
I am creating a basic website to store people profiles and within this
website
i have a page that creates a table dependent on the number of records
in mysql
written in PHP within these tables...
|
by: thegametb |
last post by:
I got this wrestling database I'm developing. It's not as straight and narrow as most sport databases are, but this has got me stumped a bit. I am trying to implement their stats in to their specific...
|
by: chumlyumly |
last post by:
Hello scripters -
OS: Mac OSX
Language: PHP w/ MySQL database
I've created an insert page where a user inputs his info, which then goes to four different tables in a MySQL database. The...
|
by: Al Moodie |
last post by:
Hi,
I have a MySQL database where I want to updated multiple records. The
table has two columns:
product_number
product_price
I have a list with first entry product_price, second entry...
|
by: javediq143 |
last post by:
Hi All,
This is my first post in this forum. I'm developing a CMS for my latest website. This CMS is also in PhP & MySQL. I'm done with the ADD section where the Admin can INSERT new records in...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
| |