i would suggest using a rand() in your php code
PHP Code:
<?php
if (isset($_POST['Submit'])) {
//$random = rand(100000,999999); <-- Generate random number for them. OR
//$raddom = $_POST['idkod']; <-- Use the input field to check against database
$result = mysql_query("SELECT idkod from table where idkod = $random");
$row = mysql_fetch_array($result)
if($row == $random) {
echo "That number already exist";
} else {
query statement for insert, send email, then redirect.
}
}
<input id="idkod" type="input">
<input type="button" value="submit">
Hope this helps. You can figure out the rest.
Bookmarks