Home > Backend Development > PHP Tutorial > php MD5加密代码

php MD5加密代码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:15:00
Original
1303 people have browsed it

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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template