Jump to content


need to convert passwords/userrnames into format my php script can use

  • Please log in to reply
2 replies to this topic


  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 17 August 2006 - 05:36 PM

: I have a newspaper website I'm developing. We have thousands of subscribers and a piece of circulation software that can give us tables of names and numbers we can use for usernames and passwords. I have a simple security script I found online that wants me to format my usernames and passwords like this:

:  'zubrag' => 'root',
:  'test' => 'testpass',
:  'admin' => 'passwd'
: );

: Is there a way I can take a chunk of names and passwords and use a program to make it format them properly? A program that can be defined to take the first word and put the ' on either side, add a space, add the =>, add another space, etc.?
: Anything you can do to help me would be most appreciated. I'm in the dark here. I need someone to point me in the right direction.

#2 trq

  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 17 August 2006 - 05:40 PM

Sorry.. I dont understand your question. You want to build a dynamic array of names and passwords from what? How does this software produce the names / passwords? Can you get them into a file? What?

#3 akrytus

  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 17 August 2006 - 05:53 PM

You mean open up the dbase of names and then read them into an array in that format?

Assuming that you have read the dbase of names probly from a file into an array $dbase.

foreach($dbase as $word){
  if($i=0){ $text="\`".$word."\` => \`root\`,";
  if($i=1){ $text="\`".$word."\` => \`testpass\`,";
  if($i=2){ $text="\`".$word."\` => \`passwd\`";

$login_information = array($array);

Not sure if that is what you mean, or if it will even work.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users