HTML Form Password value will not save to phpMyAdmin database, all the other fields are fine2019 Community Moderator ElectionSplit value from one field to twoDisplaying PHP variables in an emailUnexpected behaviour of the queryinsert concatenated value to dbTrying to encapsulate an email in <>Insert data to database not working (PHP-SQL)phpMyAdmin database: ID #s are all zeroSimple registration form using html, MySQL and phpForm validation display same error message for all fieldsunable to upload the php password field into phpmyAdmin
Why restrict private health insurance?
Do I really need to have a scientific explanation for my premise?
I can't die. Who am I?
What do *foreign films* mean for an American?
Shifting between bemols (flats) and diesis (sharps)in the key signature
How can I get players to focus on the story aspect of D&D?
Would an aboleth's Phantasmal Force lair action be affected by Counterspell, Dispel Magic, and/or Slow?
Why is there an extra space when I type "ls" in the Desktop directory?
What can I do if someone tampers with my SSH public key?
After `ssh` without `-X` to a machine, is it possible to change `$DISPLAY` to make it work like `ssh -X`?
Recommendation letter by significant other if you worked with them professionally?
Was it really inappropriate to write a pull request for the company I interviewed with?
Is a piano played in the same way as a harmonium?
Virginia employer terminated employee and wants signing bonus returned
Can one live in the U.S. and not use a credit card?
Confusion about Complex Continued Fraction
Why couldn't the separatists legally leave the Republic?
Help find my computational error for logarithms
Can I negotiate a patent idea for a raise, under French law?
Source permutation
From an axiomatic set theoric approach why can we take uncountable unions?
Expressing logarithmic equations without logs
Is it possible to avoid unpacking when merging Association?
Why does cron require MTA for logging?
HTML Form Password value will not save to phpMyAdmin database, all the other fields are fine
2019 Community Moderator ElectionSplit value from one field to twoDisplaying PHP variables in an emailUnexpected behaviour of the queryinsert concatenated value to dbTrying to encapsulate an email in <>Insert data to database not working (PHP-SQL)phpMyAdmin database: ID #s are all zeroSimple registration form using html, MySQL and phpForm validation display same error message for all fieldsunable to upload the php password field into phpmyAdmin
I made a registration form that takes email, username, firstname, etc...Only Password will not store in the database upon submission.
The field is declared correctly in the HTML file, password is set to varchar, all the other variables post but I can't pinpoint why not this password field.
Please find below my set up:(php 5.6.39)
So i corrected the "." after Username on line 25, but now it's weird.
it still doesn't post to the then actually outputs my error message "First Name and Last Name is a required field and cannot be blank."
$required = array('Email','FirstName','LastName', 'Username', 'Password');
// Loop over field names, make sure each one exists and is not empty
$error = false;
foreach($required as $field)
if (empty($_POST[$field]))
$error = true;
if ($error)
echo "First Name and Last Name is a required field and
cannot be blank.";
else
echo " Awesome, you filled it all in! ";
even when all fields are submitted
php html mysql phpmyadmin passwords
add a comment |
I made a registration form that takes email, username, firstname, etc...Only Password will not store in the database upon submission.
The field is declared correctly in the HTML file, password is set to varchar, all the other variables post but I can't pinpoint why not this password field.
Please find below my set up:(php 5.6.39)
So i corrected the "." after Username on line 25, but now it's weird.
it still doesn't post to the then actually outputs my error message "First Name and Last Name is a required field and cannot be blank."
$required = array('Email','FirstName','LastName', 'Username', 'Password');
// Loop over field names, make sure each one exists and is not empty
$error = false;
foreach($required as $field)
if (empty($_POST[$field]))
$error = true;
if ($error)
echo "First Name and Last Name is a required field and
cannot be blank.";
else
echo " Awesome, you filled it all in! ";
even when all fields are submitted
php html mysql phpmyadmin passwords
add a comment |
I made a registration form that takes email, username, firstname, etc...Only Password will not store in the database upon submission.
The field is declared correctly in the HTML file, password is set to varchar, all the other variables post but I can't pinpoint why not this password field.
Please find below my set up:(php 5.6.39)
So i corrected the "." after Username on line 25, but now it's weird.
it still doesn't post to the then actually outputs my error message "First Name and Last Name is a required field and cannot be blank."
$required = array('Email','FirstName','LastName', 'Username', 'Password');
// Loop over field names, make sure each one exists and is not empty
$error = false;
foreach($required as $field)
if (empty($_POST[$field]))
$error = true;
if ($error)
echo "First Name and Last Name is a required field and
cannot be blank.";
else
echo " Awesome, you filled it all in! ";
even when all fields are submitted
php html mysql phpmyadmin passwords
I made a registration form that takes email, username, firstname, etc...Only Password will not store in the database upon submission.
The field is declared correctly in the HTML file, password is set to varchar, all the other variables post but I can't pinpoint why not this password field.
Please find below my set up:(php 5.6.39)
So i corrected the "." after Username on line 25, but now it's weird.
it still doesn't post to the then actually outputs my error message "First Name and Last Name is a required field and cannot be blank."
$required = array('Email','FirstName','LastName', 'Username', 'Password');
// Loop over field names, make sure each one exists and is not empty
$error = false;
foreach($required as $field)
if (empty($_POST[$field]))
$error = true;
if ($error)
echo "First Name and Last Name is a required field and
cannot be blank.";
else
echo " Awesome, you filled it all in! ";
even when all fields are submitted
php html mysql phpmyadmin passwords
php html mysql phpmyadmin passwords
edited Mar 7 at 6:46
M.Hemant
38216
38216
asked Mar 7 at 5:24
alyssaalyssa
216
216
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Hey you put full stop instead of comma after UserName :
'Username','Password'
good catch! I did correct it, and it still doesn't post to the db. weird, it actually outputs my error message "First Name and Last Name is a required field and cannot be blank." $required = array('Email','FirstName','LastName', 'Username', 'Password'); // Loop over field names, make sure each one exists and is not empty $error = false; foreach($required as $field) if (empty($_POST[$field])) $error = true; if ($error) echo "First Name and Last Name is a required field and cannot be blank."; else echo " Awesome, you filled it all in! ";
– alyssa
Mar 7 at 5:48
add a comment |
Try This,
$uname = (!empty($_POST['UserName'])) ? $_POST['UserName'] : $uname;
$pword = (!empty($_POST['Password'])) ? $_POST['Password'] : $pword;
Warning for Sql Injection
Don't use direct $_POST try to sanitize it first,
thanks for your answer! will try this tomorrow, just started this class so we’re pretty basic. do i just replace lines 21 and 22 with this but also keep lines 19 and 20?
– alyssa
Mar 7 at 5:38
With the reference of @Harish please update your code and yes replace only 21 and 22
– M.Hemant
Mar 7 at 5:47
Updated, and replaced with your code, still doesn't post :(
– alyssa
Mar 7 at 5:52
are you getting an error or something else? can you share your insert code here? Can you try to echo all the $_POST & variables before line no 24?
– M.Hemant
Mar 7 at 5:55
1
Try this : $sql = "INSERT INTO users (EMAIL, FIRST_NAME, LAST_NAME, USERNAME, PASSWORD) VALUES ('".$email."','".$fname."', '".$lname."', '".$uname."', '".$pword."')";
– M.Hemant
Mar 7 at 6:07
|
show 3 more comments
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55036618%2fhtml-form-password-value-will-not-save-to-phpmyadmin-database-all-the-other-fie%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Hey you put full stop instead of comma after UserName :
'Username','Password'
good catch! I did correct it, and it still doesn't post to the db. weird, it actually outputs my error message "First Name and Last Name is a required field and cannot be blank." $required = array('Email','FirstName','LastName', 'Username', 'Password'); // Loop over field names, make sure each one exists and is not empty $error = false; foreach($required as $field) if (empty($_POST[$field])) $error = true; if ($error) echo "First Name and Last Name is a required field and cannot be blank."; else echo " Awesome, you filled it all in! ";
– alyssa
Mar 7 at 5:48
add a comment |
Hey you put full stop instead of comma after UserName :
'Username','Password'
good catch! I did correct it, and it still doesn't post to the db. weird, it actually outputs my error message "First Name and Last Name is a required field and cannot be blank." $required = array('Email','FirstName','LastName', 'Username', 'Password'); // Loop over field names, make sure each one exists and is not empty $error = false; foreach($required as $field) if (empty($_POST[$field])) $error = true; if ($error) echo "First Name and Last Name is a required field and cannot be blank."; else echo " Awesome, you filled it all in! ";
– alyssa
Mar 7 at 5:48
add a comment |
Hey you put full stop instead of comma after UserName :
'Username','Password'
Hey you put full stop instead of comma after UserName :
'Username','Password'
answered Mar 7 at 5:37
HarishHarish
699
699
good catch! I did correct it, and it still doesn't post to the db. weird, it actually outputs my error message "First Name and Last Name is a required field and cannot be blank." $required = array('Email','FirstName','LastName', 'Username', 'Password'); // Loop over field names, make sure each one exists and is not empty $error = false; foreach($required as $field) if (empty($_POST[$field])) $error = true; if ($error) echo "First Name and Last Name is a required field and cannot be blank."; else echo " Awesome, you filled it all in! ";
– alyssa
Mar 7 at 5:48
add a comment |
good catch! I did correct it, and it still doesn't post to the db. weird, it actually outputs my error message "First Name and Last Name is a required field and cannot be blank." $required = array('Email','FirstName','LastName', 'Username', 'Password'); // Loop over field names, make sure each one exists and is not empty $error = false; foreach($required as $field) if (empty($_POST[$field])) $error = true; if ($error) echo "First Name and Last Name is a required field and cannot be blank."; else echo " Awesome, you filled it all in! ";
– alyssa
Mar 7 at 5:48
good catch! I did correct it, and it still doesn't post to the db. weird, it actually outputs my error message "First Name and Last Name is a required field and cannot be blank." $required = array('Email','FirstName','LastName', 'Username', 'Password'); // Loop over field names, make sure each one exists and is not empty $error = false; foreach($required as $field) if (empty($_POST[$field])) $error = true; if ($error) echo "First Name and Last Name is a required field and cannot be blank."; else echo " Awesome, you filled it all in! ";
– alyssa
Mar 7 at 5:48
good catch! I did correct it, and it still doesn't post to the db. weird, it actually outputs my error message "First Name and Last Name is a required field and cannot be blank." $required = array('Email','FirstName','LastName', 'Username', 'Password'); // Loop over field names, make sure each one exists and is not empty $error = false; foreach($required as $field) if (empty($_POST[$field])) $error = true; if ($error) echo "First Name and Last Name is a required field and cannot be blank."; else echo " Awesome, you filled it all in! ";
– alyssa
Mar 7 at 5:48
add a comment |
Try This,
$uname = (!empty($_POST['UserName'])) ? $_POST['UserName'] : $uname;
$pword = (!empty($_POST['Password'])) ? $_POST['Password'] : $pword;
Warning for Sql Injection
Don't use direct $_POST try to sanitize it first,
thanks for your answer! will try this tomorrow, just started this class so we’re pretty basic. do i just replace lines 21 and 22 with this but also keep lines 19 and 20?
– alyssa
Mar 7 at 5:38
With the reference of @Harish please update your code and yes replace only 21 and 22
– M.Hemant
Mar 7 at 5:47
Updated, and replaced with your code, still doesn't post :(
– alyssa
Mar 7 at 5:52
are you getting an error or something else? can you share your insert code here? Can you try to echo all the $_POST & variables before line no 24?
– M.Hemant
Mar 7 at 5:55
1
Try this : $sql = "INSERT INTO users (EMAIL, FIRST_NAME, LAST_NAME, USERNAME, PASSWORD) VALUES ('".$email."','".$fname."', '".$lname."', '".$uname."', '".$pword."')";
– M.Hemant
Mar 7 at 6:07
|
show 3 more comments
Try This,
$uname = (!empty($_POST['UserName'])) ? $_POST['UserName'] : $uname;
$pword = (!empty($_POST['Password'])) ? $_POST['Password'] : $pword;
Warning for Sql Injection
Don't use direct $_POST try to sanitize it first,
thanks for your answer! will try this tomorrow, just started this class so we’re pretty basic. do i just replace lines 21 and 22 with this but also keep lines 19 and 20?
– alyssa
Mar 7 at 5:38
With the reference of @Harish please update your code and yes replace only 21 and 22
– M.Hemant
Mar 7 at 5:47
Updated, and replaced with your code, still doesn't post :(
– alyssa
Mar 7 at 5:52
are you getting an error or something else? can you share your insert code here? Can you try to echo all the $_POST & variables before line no 24?
– M.Hemant
Mar 7 at 5:55
1
Try this : $sql = "INSERT INTO users (EMAIL, FIRST_NAME, LAST_NAME, USERNAME, PASSWORD) VALUES ('".$email."','".$fname."', '".$lname."', '".$uname."', '".$pword."')";
– M.Hemant
Mar 7 at 6:07
|
show 3 more comments
Try This,
$uname = (!empty($_POST['UserName'])) ? $_POST['UserName'] : $uname;
$pword = (!empty($_POST['Password'])) ? $_POST['Password'] : $pword;
Warning for Sql Injection
Don't use direct $_POST try to sanitize it first,
Try This,
$uname = (!empty($_POST['UserName'])) ? $_POST['UserName'] : $uname;
$pword = (!empty($_POST['Password'])) ? $_POST['Password'] : $pword;
Warning for Sql Injection
Don't use direct $_POST try to sanitize it first,
answered Mar 7 at 5:33
M.HemantM.Hemant
38216
38216
thanks for your answer! will try this tomorrow, just started this class so we’re pretty basic. do i just replace lines 21 and 22 with this but also keep lines 19 and 20?
– alyssa
Mar 7 at 5:38
With the reference of @Harish please update your code and yes replace only 21 and 22
– M.Hemant
Mar 7 at 5:47
Updated, and replaced with your code, still doesn't post :(
– alyssa
Mar 7 at 5:52
are you getting an error or something else? can you share your insert code here? Can you try to echo all the $_POST & variables before line no 24?
– M.Hemant
Mar 7 at 5:55
1
Try this : $sql = "INSERT INTO users (EMAIL, FIRST_NAME, LAST_NAME, USERNAME, PASSWORD) VALUES ('".$email."','".$fname."', '".$lname."', '".$uname."', '".$pword."')";
– M.Hemant
Mar 7 at 6:07
|
show 3 more comments
thanks for your answer! will try this tomorrow, just started this class so we’re pretty basic. do i just replace lines 21 and 22 with this but also keep lines 19 and 20?
– alyssa
Mar 7 at 5:38
With the reference of @Harish please update your code and yes replace only 21 and 22
– M.Hemant
Mar 7 at 5:47
Updated, and replaced with your code, still doesn't post :(
– alyssa
Mar 7 at 5:52
are you getting an error or something else? can you share your insert code here? Can you try to echo all the $_POST & variables before line no 24?
– M.Hemant
Mar 7 at 5:55
1
Try this : $sql = "INSERT INTO users (EMAIL, FIRST_NAME, LAST_NAME, USERNAME, PASSWORD) VALUES ('".$email."','".$fname."', '".$lname."', '".$uname."', '".$pword."')";
– M.Hemant
Mar 7 at 6:07
thanks for your answer! will try this tomorrow, just started this class so we’re pretty basic. do i just replace lines 21 and 22 with this but also keep lines 19 and 20?
– alyssa
Mar 7 at 5:38
thanks for your answer! will try this tomorrow, just started this class so we’re pretty basic. do i just replace lines 21 and 22 with this but also keep lines 19 and 20?
– alyssa
Mar 7 at 5:38
With the reference of @Harish please update your code and yes replace only 21 and 22
– M.Hemant
Mar 7 at 5:47
With the reference of @Harish please update your code and yes replace only 21 and 22
– M.Hemant
Mar 7 at 5:47
Updated, and replaced with your code, still doesn't post :(
– alyssa
Mar 7 at 5:52
Updated, and replaced with your code, still doesn't post :(
– alyssa
Mar 7 at 5:52
are you getting an error or something else? can you share your insert code here? Can you try to echo all the $_POST & variables before line no 24?
– M.Hemant
Mar 7 at 5:55
are you getting an error or something else? can you share your insert code here? Can you try to echo all the $_POST & variables before line no 24?
– M.Hemant
Mar 7 at 5:55
1
1
Try this : $sql = "INSERT INTO users (EMAIL, FIRST_NAME, LAST_NAME, USERNAME, PASSWORD) VALUES ('".$email."','".$fname."', '".$lname."', '".$uname."', '".$pword."')";
– M.Hemant
Mar 7 at 6:07
Try this : $sql = "INSERT INTO users (EMAIL, FIRST_NAME, LAST_NAME, USERNAME, PASSWORD) VALUES ('".$email."','".$fname."', '".$lname."', '".$uname."', '".$pword."')";
– M.Hemant
Mar 7 at 6:07
|
show 3 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55036618%2fhtml-form-password-value-will-not-save-to-phpmyadmin-database-all-the-other-fie%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown