I have a form to complete the profile of the users I want that if some input its not filled the user can not leave the current page for example: even if he clicks on a menu which is redirected on the current page
you can do that in html by typing 'required="true"' in the input tag but it can be change in anytime by the user so i recommended to use a php filter instead. by using is_empty()
to check if it empty or not, or make a filter using filter_var($var,filter_type)
you wanna visit click here to know more about the filter
and now after we checked about empty fields and filter it, we can add the info to database, write it......,
and in the end you wanna redirect the user to another page using header("location:index.php");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.