0
目前我的電子郵件地址接受所有電子郵件域名。我想定義列表中允許哪些列表(solent.ac.uk,herts.ac.uk),而不是公共列表,比如@ gmail.com等。無論哪種方式最簡單,我會嘗試替代現在的方式,這只是暫時的。檢查電子郵件是否符合指定的域名或拒絕
<form method="post" action="<?php url_for('register'); ?>">
<!--Email-->
<p class="email field">
<input tabindex="1" id="email" type="text" name="email" value="<?php if(isset($_POST['email'])) echo $_POST['email']; ?>" placeholder="[email protected]" autofocus />
<a href="<?php url_for('login'); ?>" tabindex="2" class="action button register" title="Click to log-in with your existing account.">Login</a>
</p>
謝謝。
我會用'名單(,$域)= array_pad去(爆炸( '@',$電子郵件,2),2, '');'因爲當數組大小不合適時,「list」是相當無情的。 – Yoshi
好的提示。我會更新我的答案,包括這一點。謝謝。 –
我明白那個代碼在做什麼,但是我把它放在哪裏不確定。我是一名PHP初學者。 – wharfdale