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










0















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)
enter image description here



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










share|improve this question




























    0















    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)
    enter image description here



    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










    share|improve this question


























      0












      0








      0








      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)
      enter image description here



      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










      share|improve this question
















      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)
      enter image description here



      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 at 6:46









      M.Hemant

      38216




      38216










      asked Mar 7 at 5:24









      alyssaalyssa

      216




      216






















          2 Answers
          2






          active

          oldest

          votes


















          2














          Hey you put full stop instead of comma after UserName :



          'Username','Password'






          share|improve this answer























          • 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


















          0














          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,






          share|improve this answer























          • 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










          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
          );



          );













          draft saved

          draft discarded


















          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









          2














          Hey you put full stop instead of comma after UserName :



          'Username','Password'






          share|improve this answer























          • 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















          2














          Hey you put full stop instead of comma after UserName :



          'Username','Password'






          share|improve this answer























          • 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













          2












          2








          2







          Hey you put full stop instead of comma after UserName :



          'Username','Password'






          share|improve this answer













          Hey you put full stop instead of comma after UserName :



          'Username','Password'







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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













          0














          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,






          share|improve this answer























          • 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















          0














          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,






          share|improve this answer























          • 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













          0












          0








          0







          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,






          share|improve this answer













          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,







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme