php - Get MySQL row with HTML textbox, return column -
i have mysql database containing table called hashes_md5 these columns: plain,hash
. want make simple php script user inputs text within textbox. php script should text in column 'plain' , if exists, return value column 'hash' corresponding row. have connection mysql server done:
<?php $connection = mysql_connect("localhost", "root","password"); or die ("error occured. credentials correct?"); mysql_select_db("hashes") or die ("error occured. database doesn't exist."); $query = "select plain, hash hashes_md5"; $result = mysql_query($query); while($row = mysql_fetch_object($result)) { echo "$row->plain, $row->hash <br>"; } ?>
how can this?
and have done?
here sql command rest you:
select hash hashes_md5 plain='$plain_escaped_hash'
but sure? hash 1 way encoding, can md5() input , print out! if user wants crack hash can enter hash , can search him in database equal plain text of hash !
Comments
Post a Comment