首頁 > 後端開發 > php教程 > php MD5加密代码

php MD5加密代码

WBOY
發布: 2016-06-13 12:15:00
原創
1299 人瀏覽過

php MD5加密代码:

<code class=" hljs handlebars"><span class="xml"><span class="hljs-tag"><<span class="hljs-title">body</span> <span class="hljs-attribute">style</span>=<span class="hljs-value">"color:green;font-size:28px;background:black;font-family:Verdana, sans-serif;"</span>></span><span class="php"><span class="hljs-preprocessor"><?php</span> error_reporting(<span class="hljs-number">0</span>);<span class="hljs-preprocessor">?></span></span><span class="hljs-tag"><<span class="hljs-title">form</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">"c"</span> <span class="hljs-attribute">action</span>=<span class="hljs-value">"<?php echo $_SERVER['PHP_SELF'];?>"</span> <span class="hljs-attribute">method</span>=<span class="hljs-value">"get"</span>></span>Input your text:<span class="hljs-tag"><<span class="hljs-title">input</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">"text"</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">"c"</span> /></span><span class="hljs-tag"><<span class="hljs-title">button</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">"submit"</span> <span class="hljs-attribute">value</span>=<span class="hljs-value">"Submit"</span> <span class="hljs-attribute">style</span>=<span class="hljs-value">"color:green;font-size:28px;background:black;"</span>></span>Creat!<span class="hljs-tag"></<span class="hljs-title">button</span>></span><span class="hljs-tag"></<span class="hljs-title">form</span>></span><span class="hljs-tag"></<span class="hljs-title">body</span>></span><span class="php"><span class="hljs-preprocessor"><?php</span><span class="hljs-comment">//hash encode:</span><span class="hljs-keyword">if</span>(<span class="hljs-variable">$c</span>=<span class="hljs-variable">$_GET</span>[<span class="hljs-string">'c'</span>])<span class="hljs-keyword">echo</span> <span class="hljs-string">'Roger!Your MD5 code is:<br>'</span>.md5(<span class="hljs-variable">$c</span>).<span class="hljs-string">'(32bit)<br>'</span>.substr(md5(<span class="hljs-variable">$c</span>),<span class="hljs-number">8</span>,<span class="hljs-number">16</span>).<span class="hljs-string">'(16bit)'</span>;<span class="hljs-comment">//截取8到24就是16位的hash,便于储存</span><span class="hljs-preprocessor">?></span></span></span></code>
登入後複製
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板