I cant seem to work out why my random number is generating the same result on refresh or back btn on the browser. or if there is an error with the email such as a duplicate entry the header saids to go back to the register page to fill in details again.
Briefly: I'm trying to create a new number sequence in my database every time I register a new user, what's happening is the users are receiving the same random number most times if i was to refresh the form or press back on the browser, the number sequence is called only on submit
<?php
$create_account = substr(number_format(time() * rand(),0,'',''),0,10);
//etc
if ($insert_stmt = $mysqli->prepare("INSERT INTO members (username, email,
password,salt, account, registered ) VALUES (?, ?, ?, ?,$create_account, now())"))
// Database looks like this after it is inserted, check the account column.
...................................................................................
| id | username | email | paswword | salt | account | registered |
....................................................................................
| 1 | david | [email protected] |dfg8dfgdfgg |dfgdfgdfg| 2323232329 | 10/8/2013 |
....................................................................................
| 2 | bill | [email protected] |sdfsdfsdfspz|wpzz9kecm| 2323232329 | 11/26/2013 |
....................................................................................
I dont understand why this function is not recalculating every-time the page.php is requested once i fill the form for a new user.
check the image: