redarrow Posted August 26, 2009 Share Posted August 26, 2009 how can i get the name of the array that are part off the array. example <?php $users=array("john"=>"dog","paul"=>"mouse","smith"=>"kitten"); ?> say i wanted to add passwords manualy in a array order how it done . this is tottally wrong man going nuts lol. <?php $current_user="john"; $current_password="dog"; $users=array("john"=>"dog","paul"=>"mouse","smith"=>"kitten"); if(in_array($current_user,$users)&& in_array($current_password,$users)){ echo "$current_user <br><br> <b>SECREAT INFO:</b>"; }else{ echo"You are currently not on my list of active user's please contact us imaditly."; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/171891-solved-how-to-get-the-array-name-cheers/ Share on other sites More sharing options...
Philip Posted August 26, 2009 Share Posted August 26, 2009 Uhh, maybe I just had a long day, but I have no clue what part of the array you're asking for? Quote Link to comment https://forums.phpfreaks.com/topic/171891-solved-how-to-get-the-array-name-cheers/#findComment-906378 Share on other sites More sharing options...
redarrow Posted August 26, 2009 Author Share Posted August 26, 2009 i want to no them both as a password match but using array literal names and results as u can see the in_array will work but only with the result now i need to add another array function to read what was the litral name of that array. <?php $current_user="john"; $current_password="dog"; $users=array("john"=>"dog","paul"=>"mouse","smith"=>"kitten"); if(in_array($current_user,$users)&& in_array($current_password,$users)){ echo "$current_user <br><br> <b>SECREAT INFO:</b>"; }else{ echo"You are currently not on my list of active user's please contact us imaditly."; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/171891-solved-how-to-get-the-array-name-cheers/#findComment-906379 Share on other sites More sharing options...
Philip Posted August 26, 2009 Share Posted August 26, 2009 if(isset($users[$current_user]) && $users[$current_user]==$current_password) { // show secret stuff } like that? Quote Link to comment https://forums.phpfreaks.com/topic/171891-solved-how-to-get-the-array-name-cheers/#findComment-906380 Share on other sites More sharing options...
redarrow Posted August 26, 2009 Author Share Posted August 26, 2009 but using the array as printed your good Quote Link to comment https://forums.phpfreaks.com/topic/171891-solved-how-to-get-the-array-name-cheers/#findComment-906381 Share on other sites More sharing options...
redarrow Posted August 26, 2009 Author Share Posted August 26, 2009 i want to no them both as a password match but using array literal names and results as u can see the in_array will work but only with the result now i need to add another array function to read what was the litral name of that array. <?php $current_user="john"; $current_password="dog"; $users=array("john"=>"dog","paul"=>"mouse","smith"=>"kitten"); if(in_array($current_user,$users)&& in_array($current_password,$users)){ echo "$current_user <br><br> <b>SECREAT INFO:</b>"; }else{ echo"You are currently not on my list of active user's please contact us imaditly."; } ?> i got you all thinking it all good, but i need to use the name off the littoral array name help lol Quote Link to comment https://forums.phpfreaks.com/topic/171891-solved-how-to-get-the-array-name-cheers/#findComment-906382 Share on other sites More sharing options...
Philip Posted August 26, 2009 Share Posted August 26, 2009 Huh? Replace: if(in_array($current_user,$users)&& in_array($current_password,$users)){ with if(isset($users[$current_user]) && $users[$current_user]==$current_password) { Quote Link to comment https://forums.phpfreaks.com/topic/171891-solved-how-to-get-the-array-name-cheers/#findComment-906394 Share on other sites More sharing options...
redarrow Posted August 26, 2009 Author Share Posted August 26, 2009 cheers king. but while your there pal , have you used the curl to get hotmail messages throw php or your users from hotmail from php using curl. got a dating site goes well but find it imposable to create somethink to get anything from hotmail service any idears pal. Quote Link to comment https://forums.phpfreaks.com/topic/171891-solved-how-to-get-the-array-name-cheers/#findComment-906396 Share on other sites More sharing options...
.josh Posted August 26, 2009 Share Posted August 26, 2009 dude, even as I'm smashed I can't understand a damn thing you are saying redarrow. I was sure that was the key...fuck man.. don't take that the wrong way, not makin' fun of you... but seriously, I want to try an experiment. Can you post your question in your native tongue and let me run it through google translator? Seriously. Really am curious. I want to compare results. Maybe I'll understand the google translator so I can help you out. Yeah. That's it. Quote Link to comment https://forums.phpfreaks.com/topic/171891-solved-how-to-get-the-array-name-cheers/#findComment-906410 Share on other sites More sharing options...
Zane Posted August 26, 2009 Share Posted August 26, 2009 dude, even as I'm smashed I can't understand a damn thing you are saying redarrow. I was sure that was the key...fuck man.. don't take that the wrong way, not makin' fun of you... but seriously, I want to try an experiment. Can you post your question in your native tongue and let me run it through google translator? Seriously. Really am curious. I want to compare results. Maybe I'll understand the google translator so I can help you out. Yeah. That's it. that's some godamned funny shit.. Quote Link to comment https://forums.phpfreaks.com/topic/171891-solved-how-to-get-the-array-name-cheers/#findComment-907130 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.