Skip to content Skip to sidebar Skip to footer

My Php/html Submit Button Does Not Register Being Pressed

Below is my code for register.php on my website. This code allows the user to register for my website, creating a MySQL entry for username, email, password, etc. on clicking the su

Solution 1:

I think you mixed up the button's type attribute, i.e. it's not button, but submit.

So, I guess you have a normal text input field, but your CSS is cheating your eyes. Try writing into it :)

To submit forms via buttons you can use:

<inputtype="submit"name="reg"value="Register!"/><buttonname="reg"value="1-or-anything">Register!</button>

And as for a possible different way of coding (getting all the validation errors at once):

$error_list = array();
if ($condition1) $error_list[] = 'My Error message 1';
if ($condition2) $error_list[] = 'My Error message 2';
if ($condition3) $error_list[] = 'My Error message 3';
...
if (empty($error_list)) the_fun_part();
else {
    foreach($error_listas$msg)
        echo"{$msg}<br/>";
}

Post a Comment for "My Php/html Submit Button Does Not Register Being Pressed"