Nested if/else/elseifs are usually too complex for me to figure out.
I’d change your code to use SWITCH/CASE to determine proper input and to change the password if all is OK.
And to sanitize $_POST (and $_GET) inputs, I just put this in my functions file:
$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
Then I don’t have to remember to sanitize things elsewhere.
Related Posts:
- Is there any good tutorial to write custom login, registration and password recovery forms? [closed]
- Tips on using a custom template with Ultimate Member
- Contact form 7 select box different value-text than content-text in option [closed]
- Where the Nickname is being used in WordPress
- Remove WordPress Toolbar buttons
- Let readers suggest edits from the frontend
- shortcode doesn’t work
- Is it possible to block subscriber users to changing its password?
- Template plugin for blog posts? [closed]
- Remove toolbar option (and set to default to no) in user profile
- How to create a word press user with hashedpassword
- WordPress plugin form not saving data
- jQuery Plugin to use WordPress functions in AJAX request
- WordPress login with Phone Number [closed]
- Add form fields dynamically on button click
- How to trigger $_GET request within admin plugin page?
- Retrieving a Value from a wp-database
- Custom CSS for plugin form
- Form doesn’t submit on second submit call
- WP plugins for building a database?
- Custom form action to handle data inside a plugin
- Image upload and other options in the same plugin settings form?
- Information and Videos for Customers in the Backend [closed]
- When using Simple Fields plugin, how do I pull the information out of the database to display on a page?
- Creating an online questionnaire form – by Importing the questions from a spreadsheet?
- Can I use custom CSS and js plugin to put JavaScript in to validate my forms
- Using a custom plugin to capture input data via Ajax and PHP
- Redirect already logged in users away from a page to a specific page base on user role
- auto populate list of questions if user select a category xyz
- WordPress WPforms customization
- Submit page limited in time to upload image
- Ajax fail and get 504 error
- How to insert HTML/JavaScript form into WordPress page? [closed]
- How to redirect users to their profile after they successfully edit their profile
- How to fetch form data and show it to my page?
- Submit custom form from post content and execute in plugin
- Char limit on custom blog-post form? [closed]
- Enqueue stylesheet in plugin for wp-login.php
- Is there a way to embed a Google Docs form in a page without using plugins?
- easy steps to make front end form without plugin
- Form that generates an ID for the customer
- Completely disabling password reset/recovery
- How to have sample page for each new register users in a membership website
- Submit Form data to another page via Ajax (WordPress Way)
- How to extract data from ‘edit my profile’ page in WordPress?
- Editing a text file from plugin menu
- Ajax Plugin Not Echoing Response
- Plugin that will output submitted form data for user? [closed]
- How to handle forms from sidebar widgets – Processing $_POST variables using get_field_name()
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- Creating a form and displaying entry data as a table
- Gravity Forms returns to odd position
- Storing The Data Collected by Ninja Forms into Another (custom) Database [closed]
- add_meta_box creating default form field types
- Form Plugin for Api Requests which is used via Shortcode
- Echo out element to another page.
- Select Form Element Not Saving from Plugin Options
- Storing Form data in a different database
- Using AJAX to run SQL statement and populate dropdown
- Looking for a simple checkout plugin [closed]
- Redirect plugin after form submit or show errors
- get wpforms ID value from ACF text field
- User loggedin as Subscriber form not sending
- How to create a form where you can select multiple recipients, based on a list of website users?
- WordPress search input in database, to edit information via form and update the database
- Create Woocommerce account password post-checkout on thank you page
- WPForms Custom Redirect not working
- Automatic chage password of pages after some time
- Login/password protected “client page”
- Login issue in WordPress
- Password Protect wp-content?
- Meta Key array building with multiple input values from fields
- Members-only page, but accessible via sharable link
- Create password protected page, no registration
- Page takes on two different formats
- Cant visualize protected password portfolio elements
- get/show Last ID
- Is there a function to search for a wildcard value when calling a shortcode?
- Create user assessment and use results in sql query
- Saving custom form fields
- Adding a Filter to Sidbar Login Plugin to Change Login Button Lable
- Create plugin with form in post and submit it to specific form
- Link Forms on WordPress
- Alter the reset password link
- Capturing POST data
- Password Protected Directory Link Shows Maintenance Mode Page
- Displaying custom profile fields using Mingle Plugin
- Undefined variable _POST
- Is it possible to send user new password after they clicking on forgot password in word press
- How to prevent page load on form submission
- How to develop an extension for a simple form post and post back? [closed]
- My WP site and password was hacked, what to do? [closed]
- How to validate password length in wordpress
- Plugin Beauty Contact Popup Form with while loop
- Is it possible to set different payment gateway on each Gravity Forms form? [closed]
- how to show selected options drop down menu values in attributes field in after saving post.php
- How to Allow Users to Select Recipients In a WordPress Comment section?
- Form with response button after on table after submission
- Issues with creating user profile for a subscriber, but with different profile page and functionalities
- Can’t save formdata in DB