XODAVEOX Posted August 17, 2006 Share Posted August 17, 2006 : 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:: $LOGIN_INFORMATION = array(: '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. Quote Link to comment Share on other sites More sharing options...
trq Posted August 17, 2006 Share Posted August 17, 2006 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? Quote Link to comment Share on other sites More sharing options...
akrytus Posted August 17, 2006 Share Posted August 17, 2006 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.[code]$array="";$i=0;foreach($dbase as $word){ if($i<2){$i++;} else{$i=0;} if($i=0){ $text="\`".$word."\` => \`root\`,"; if($i=1){ $text="\`".$word."\` => \`testpass\`,"; if($i=2){ $text="\`".$word."\` => \`passwd\`"; $array=$array.$text;}$login_information = array($array);[/code]Not sure if that is what you mean, or if it will even work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.