mercredi 25 mars 2015

Submit button not submitting on a form

I have set up a registration form and my submit button won't pass through to populate my database with the registration information. The code snipet shows the start of my form and some fields that are included in it.


I had this set up in a table, rather than a form and it seemed to work but when I changed it to a form it stoped working. I've looked at a few other links on here such as this one HTML PHP Contact Form - Submit Button Not Working? Or PHP Issue? But I can't seem to get it working.


Any help appreciated, thanks.





<div class = "contact">
<form class="form-horizontal" role="form" method="post" action=" <?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?> ">
<div class="form-group">
<label for="name" class="col-sm-2 control-label">Username:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="username" name="username" value="<?php echo $username ?>">
<span class="error"><?php echo getErrorMessage('username', $error); ?></span>
</div>
</div>

<div class="form-group">
<label for="password" class="col-sm-2 control-label">Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="password" name="password" value="<?php echo $password ?>">
</div>
</div>

<div class="form-group">
<label for="conPass" class="col-sm-2 control-label">Confirm Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="conPassword" name="conPassword" value="<?php echo $conPass ?>">
</div>

<div class="col-sm-10">
<input id="button" name="reg" type="submit" value="Register" class="btn btn-primary">
</div>
</div> <!-- registration button -->

</form>
</div> <!-- registration end -->



Aucun commentaire:

Enregistrer un commentaire