kevinkhan Posted November 22, 2010 Share Posted November 22, 2010 hi guys usename:password user1:pass1 user2:pass2 user3:pass2 i have a function fun(username,pass) and i want to run it for lots of different user names and passwords. what would the best way to do this? would i make an array and use a foreach loop or how would i do it and what could would i need?? Quote Link to comment https://forums.phpfreaks.com/topic/219455-need-some-logic-for-a-simple-problem/ Share on other sites More sharing options...
MrXHellboy Posted November 22, 2010 Share Posted November 22, 2010 What do you want with this.... ? Quote Link to comment https://forums.phpfreaks.com/topic/219455-need-some-logic-for-a-simple-problem/#findComment-1137919 Share on other sites More sharing options...
ManiacDan Posted November 22, 2010 Share Posted November 22, 2010 Yeah...we generally don't help people crack passwords, especially when it's so trivial. Quote Link to comment https://forums.phpfreaks.com/topic/219455-need-some-logic-for-a-simple-problem/#findComment-1137943 Share on other sites More sharing options...
kevinkhan Posted November 22, 2010 Author Share Posted November 22, 2010 crack passwords?? no i have 5 facebook accounts and want to post something to my wall on all the accounts Quote Link to comment https://forums.phpfreaks.com/topic/219455-need-some-logic-for-a-simple-problem/#findComment-1137970 Share on other sites More sharing options...
ManiacDan Posted November 22, 2010 Share Posted November 22, 2010 Having 5 facebook accounts is a violation of facebook's TOS. Even so, "use an array" is the answer. Specifically, use an array and a loop. If you need more than that, "learn how to program" is good advice. There are plenty of threads on how to do that. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/219455-need-some-logic-for-a-simple-problem/#findComment-1137975 Share on other sites More sharing options...
kevinkhan Posted November 22, 2010 Author Share Posted November 22, 2010 would it be like this? $accounts = array("user1", "user2", "user3", "user4"); foreach($accounts as $account) { function($account) } Quote Link to comment https://forums.phpfreaks.com/topic/219455-need-some-logic-for-a-simple-problem/#findComment-1137980 Share on other sites More sharing options...
ManiacDan Posted November 22, 2010 Share Posted November 22, 2010 Have you tried that? Add output to your script so you know it's working right. Then run it, and see if the output is what you expect. You don't need us to tell you if PHP will run a script properly, that's why you have the PHP interpreter. Quote Link to comment https://forums.phpfreaks.com/topic/219455-need-some-logic-for-a-simple-problem/#findComment-1137996 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.