ssjrocks Posted December 15, 2011 Share Posted December 15, 2011 <?php $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; $invalid = '0'; echo '<center><a href="view.php">Browse</a>|<a href="search.php">Search</a>|<a href="update.php">update</a>|</center><BR><BR><BR>'; echo str_repeat(' ', 256).'<pre>'; flush(); ob_start(); include('sql.php'); include('functions.php'); mysql_select_db($dbname, $con); $nh = '0'; $ru = '0'; if (!$con) { die('Could not connect: ' . mysql_error()); } $pp = $_POST["data"]; $delim = $_POST["delim"]; $last = '0'; $data = explode("\n", $pp); $resultf = array_unique($data); $tot = count($resultf); $dupl = count($data) - count($resultf); echo $dupl . ' Duplicates Removed... Processing ' . $tot . ' Records.'; echo '<BR><BR>'; create_progress(); $counter = '0'; foreach ($resultf as $line) { $plainpass = explode($delim, $line); ++$counter; if (md5($plainpass[1]) != $plainpass[0]){ ++$invalid; next($resultf); } if(recordExists('passhash',$plainpass[0])){ mysql_query("UPDATE megatable SET plainpass = '" . $plainpass[1] . "' WHERE passhash = '" . $plainpass[0] . "' AND plainpass = ''"); $ru = $ru + mysql_affected_rows(); } else{ mysql_query("INSERT INTO megatable (passhash, plainpass) VALUES ('" . $plainpass[0] . "', '" . $plainpass[1] . "')"); $nh = $nh + mysql_affected_rows(); } $prog = $counter / $tot * 100; $prog = round($prog); if($last != $prog){update_progress($prog);} $last = $prog; unset($resultf[$last]); } mysql_close($con); echo '<BR>done'; echo '<BR>' . $nh . ' New Hashes added to Db'; echo '<BR>' . $ru . 'Hashes Updated with plainpass'; echo '<BR>From ' . $tot . ' Unique inputs'; echo "<BR>" . $invalid . " Illegal Entries Ignored.<BR>"; echo '<BR><BR>'; $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4); echo 'Page generated in '.$total_time.' seconds.'."\n"; ?> im having problems around the if (md5($plainpass[1]) != $plainpass[0]){ line if i import 5000 records it replies that 4999 are illegal entried ...(the md5 of the plainpass does not match data supplie... even tho i know it does) any help would be apreciated i have checked and i am sending clean data to the script no spaces \n's or anything like that Quote Link to comment https://forums.phpfreaks.com/topic/253197-re-md5plainpass1/ 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.