Heim  >  Artikel  >  Backend-Entwicklung  >  php-JS表单里怎样写唯一标示符,求指导,谢谢!

php-JS表单里怎样写唯一标示符,求指导,谢谢!

WBOY
WBOYOriginal
2016-06-02 11:32:16946Durchsuche

php表单javascrpit

<code> layer += '<div class="layer_title">
<h1>注册</h1>
<a href="javascript:;" title="关闭">x</a>
</div>';         layer += '<form action="register.php" method="POST" id="registerForm"><ul>'; //layer_cont          layer += '<b>*</b>:<input type="hidden" name="uniqid" id="uniqid" value="<?php $st?>">';         layer += '<li>
<span>账  号<b>*</b>:</span><input type="text" class="layer_txt" placeholder="至少两位" name="username" id="uname">
</li>';         layer += '<li>
<span>密  码<b>*</b>:</span><input type="password" class="layer_txt" placeholder="至少六位" name="password" id="pwd">
</li>';         layer += '<li>
<span>确认密码<b>*</b>:</span><input type="password" class="layer_txt" placeholder="至少六位" name="notpassword" id="repwd">
</li>';        layer += '<li>
<span>电子邮箱<b>*</b>:</span><input type="text" class="layer_txt" placeholder="您常用的邮箱地址" name="email" id="email">
</li>';                    layer += '</ul></form>';        layer += '<div class="layer_btn"><input type="button" id="ressub" class="layer_submit_btn" value="提交"></div>'; <?php $_SESSION['st']=$st=sha1(uniqid[rand(),true));?></code>

这样写不行的,但我不知道怎样写了。
如果在JS表单跳转后的一个验证表单的PHP文件里面再去写可以吗。。但那时候生成的uniqid是不是又变了

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn