Page 1 of 1

new user email address not inserted into database table

PostPosted: 09. July 2016 18:04
by leonpowell
I have set up a registration form and it inserts new user information into a mysql or mariadb just fine except for email address and password. On the form it always shows local host and in the database just displays 'email' in the email field and the same coded SHA1 password in the password field. Can you tell me how to correct this so that when i type in an email address and password for each individual new user that it accepts this and puts it into the new user table.

cheers

Re: new user email address not inserted into database table

PostPosted: 09. July 2016 23:23
by Altrea
leonpowell wrote:Can you tell me how to correct this

Without knowing your source code? you are kidding.

Re: new user email address not inserted into database table

PostPosted: 11. July 2016 13:46
by leonpowell
Sorry about that. My first time on a forum

<form action="action_handler.php" method="POST" class="register">
<fieldset>
<label>Register</label>
<p>
<input type="text" name="username" placeholder="Enter Username"/>

<select name="country" placeholder="Location">
<option value="">Location</option>
<option value="afghanistan">Afghanistan</option>
<option value="albania">Albania</option>
<option value="algeria">Algeria</option>
<option value="andorra">Andorra</option>
<option value="angola">Angola</option>
<option value="antigua and Barbuda">Antigua and Barbuda</option>
<option value="argentina">Argentina</option>
<option value="armenia">Armenia</option>
<option value="australia">Australia</option>
<option value="austria">Austria</option>
<option value="azerbaijan">Azerbaijan</option>
<option value=""></option>
</select>

</p>
Tell us who you are
<p>
<select type="select" name="date_match">
<option disabled selected>Who are you?</option>
<option value="male">Male seeking females</option>
<option value="female">Female seeing males</option>
<option value="gayMale">Male seeking males</option>
<option value="gayFemale">Female seeking females</option>
</select>
</p>
Your date
<p>
<input type="number" name="min_age" min="18" max="90" placeholder="min age"/>
<input type="number" name="max_age" min="18" max="90" placeholder="max age"/>
</p>
<p>
<input type="email" name="email" placeholder="Email Address"/>
<input type="password" name="password" placeholder="Create a password"/>

</p>

<input type="submit" value="continue">
</fieldset>

</form>

When i fill in the email and password fields with different email addresses and passwords it just posts the word 'email' to the email field and the SHA1 coded password to the password field when i add different users to the mysql table.

Just wondered if there was a solution. It's bugging me that's all.

Cheers

Re: new user email address not inserted into database table

PostPosted: 11. July 2016 15:28
by Nobbie
Still no PHP code. We need the PHP script, which does the SQL Insert (action_handler.php). The HTML code does not connect to the MySQL Database.

Is this really YOUR code (your HTML, your PHP?)? i definately doubt it. Obviously, you have no clue how things are working together.

Re: new user email address not inserted into database table

PostPosted: 11. July 2016 15:54
by Altrea
As Nobbie already mentioned, the error you described is in your php code.
But your HTML code snippet is not valid too. You should use a HTML validator.