<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[url]http://www.w3.org/TR/html4/loose.dtd">[/url] <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <title>MD5編碼轉換</title> <link href="../e-learn.css" rel="stylesheet" type="text/css"> </head> <body> <div align="center"> <form action="0001.php" method="post" enctype="application/x-www-form-urlencoded" name="form1" target="_self"> <p>請將您的原始字串貼入下面的文字欄位中 </p> <p> <textarea name="textarea1"></textarea> </p> <p> <input type="submit" name="Submit" value="轉換成MD5編碼"> </p> <p>以下為您的原始字串經過MD5編碼轉換後的結果</p> <p> <?php if($_POST['textarea1']!=""){ echo md5($_POST['textarea1']); }else{ echo "您沒有輸入任何字串!"; } ?> </p> </form> </div> </body> </html>
<?php $str="請在這邊打入妳的密碼"; $str_md5=md5($str); echo $str_md5; ?>