I've just started to learn PHP - Not very good. I have created a form (see below) which I would like people to sign up to but I would like to limit this to a certain number of members. For example 4 users can sign up when it reaches that amount it will hide the form and display a message saying "sorry, you have reached the user account limit."
<form action="users.php?new=1" method="post">
<input type="hidden" name="action" value="newUser"/>
<input type="hidden" name="id" value="0"/>
<fieldset>
<legend>Add new user</legend>
<?php if(isset($msg)) { echo $msg;}?>
<p>
<label>Full name: </label>
<input name="name" value="<?php if(isset($name)) { echo $name;}?>" style="width:400px;"/>
</p>
<p>
<label>Email: </label>
<input name="email" value="<?php if(isset($email)) { echo $email;}?>" style="width:400px;"/>
</p>
<p>
<label>Password: </label>
<input name="password" type="password" value="" style="width:400px;"/>
</p>
<p>
<label>Phone number: </label>
<input name="phone" value="<?php if(isset($phone)) { echo $phone;}?>" style="width:400px;"/>
</p>
<p>
<label>User level:</label>
<select name="access" class="dropdown">
<option value="no" <?php if(isset($access)) { if ($access =='no'){ echo ' selected="selected" ';}}?>>User</option>
<option value="yes" <?php if(isset($access)) { if ($access =='yes'){ echo ' selected="selected" ';}}?>>Admin</option>
</select>
Note: Admin users will have full access to all areas.
Please can someone help me! Code would be lovely!
Thanks, Charlie