0

What is the importance of putting php "isset" in the value attribute of inputs.I am having a little confusion.

Why not just validate input fields in a separate php file. I want to know if putting php post in value attribute of input tags is important and why is it important?

15th Aug 2019, 6:15 PM
prime omondi
prime omondi - avatar
1 ответ
+ 1
The importance of PHP isset: Isset is usually used to specify if the submit button is pressed. If by some other problem user reaches the validation page without entering any data, and our PHP code doesn't look if the user pressed or not it could lead to giving hackers access. Also it may result in an error that there is no value. We need to put post so that the data send is not public. For example when the user presses submit and if the value is set to: a)GET - Then the form will redirect to the PHP file with the input values in the URL itself. Ex. https://example.com/login.php/?username="admin" b)POST- Then the form will redirect to the PHP file with the input values hidden. Ex. https://example.com/login.php That's all its simple easy.. Hope it helps. If you have any more doubts regarding to PHP. You can message me, No problem.
20th Aug 2020, 9:21 AM
Steve Sajeev
Steve Sajeev - avatar