Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

PHP IMAP AUTHENTICATION, GIVE ME GOOD AND BAD LOGIN IN TXT HELP

i have a php IMAP code i wrote that makes me manually type in my email and password to validate/authenticate, if i input wrong password it gives me "not connect" if i type in my right password it displays "CONNECT"

 
PHP Code

<?
    $email = $_REQUEST['email'];
    
    $domcom = trim(strstr($email, '@'), '@');
    
    $mbox = imap_open("{mail.$domcom:993/imap/ssl/novalidate-cert/notls}", "[email protected]", "password");
    if ($mbox == true) {
        echo "CONNECT";
    }
    else {
    echo "NOT CONNECT";
    }
    ?>
so what i needed is this i don't want to be manually typing it myself again i need a help with fixing the script for it to do the work automatically that i have my email:password like this in a log.txt in this format below for example E.g

[email protected]:password1
[email protected]:password2
[email protected]:password3
[email protected]:password4
[email protected]:password5
[email protected]:password6
[email protected]:password7
[email protected]:password8
[email protected]:password9
[email protected]:password10
[email protected]:password11
[email protected]:password12


so if i run the imap.php script on browser it checks them automatically line by line till it finishes gives me "good.txt" for authenticated login that connects and "bad.txt" for bad login / error login

Note: i want the imap server in quote "" to remain the same

PHP Code

<?php 
{mail.$domcom:993/imap/ssl/novalidate-cert/notls} 

make $domcom grab the domain part in each line of the txt and post/replace it on the imap server line for checking each lines
[*] Everyone has a will to WIN but very few have the will to prepare to WIN [*]
Code
<?php

$accs = file('acc.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);

foreach ($accs as $acc) {
    $details = explode(':', $acc);
    $domcom = trim(strstr($details[0], '@'), '@');
    $mbox = imap_open("{mail.$domcom:993/imap/ssl/novalidate-cert/notls}", $details[0], $details[1]);
    
    if ($mbox === true) {
        echo "CONNECT";
    } else {
        echo "NOT CONNECT";
    }
}

Next time, at least attempt to create it yourself and ask for help with what you can't figure out. This really is just some simple Googling.
(Jan 26, 2022 04:29 PM)False King Wrote:  
Code
<?php

$accs = file('acc.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);

foreach ($accs as $acc) {
    $details = explode(':', $acc);
    $domcom = trim(strstr($details[0], '@'), '@');
    $mbox = imap_open("{mail.$domcom:993/imap/ssl/novalidate-cert/notls}", $details[0], $details[1]);
   
    if ($mbox === true) {
        echo "CONNECT";
    } else {
        echo "NOT CONNECT";
    }
}

Next time, at least attempt to create it yourself and ask for help with what you can't figure out. This really is just some simple Googling.

Thank you but i needed it to give me good.txt and bad.txt with sumthing like fopen("good.txt"); for good logins that authenticate fopen("bad.txt"); for bad login error
[*] Everyone has a will to WIN but very few have the will to prepare to WIN [*]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Javascript]  by TrojanJun 29, 2022 08:52 AM 1 205 Jun 29, 2022 08:52 AM
Last Post: Empty Throne
[PHP] by SREESep 13, 2020 05:46 AM 3 191 Sep 13, 2020 05:46 AM
Last Post: SREE
[Javascript]  by smtpzJul 31, 2020 06:41 AM 2 111 Jul 31, 2020 06:41 AM
Last Post: smtpz