Jump to content

Doesn't list more than one account?


3raser

Recommended Posts

The below script WILL list one account successfully, but how come this script doesn't list more than one  account when <b>listAccounts()</b> is called?

 

EXAMPLE OF accounts.txt FILE:

username:blah
user526:pass
justinlh:justin

 

                 function listAccounts()
                {
                    //load all the accounts
                    $accounts = loadAccounts();
                    
                    //display each account in the drop-down box
                    foreach($accounts as $account)
                    {
                       $account_split = explode(':', $account);
                        
                       echo '<option value="'. $account .'">'.$account_split[0].'</option>';
                    }
                }
                
                function loadAccounts()
                {
                    /*  EXAMPLE OF ACCOUNTS.TXT
                     *  http://pastebin.com/zAPH0a4J
                     */
                    
                    $handle = fopen('accounts.txt', 'r');
                    $accounts = fread($handle, filesize('accounts.txt'));
                    fclose($handle);
                    
                    return explode('\n', $accounts);
                }

Link to comment
https://forums.phpfreaks.com/topic/259832-doesnt-list-more-than-one-account/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.