Sanitizing $_POST input
-
So I have the following code:
‘$fname = ($_POST[‘first_name’]);’
to
‘$fname = esc_attr($_POST[‘first_name’]);’ ??
—————————————————–
$email = $_POST[‘user_email’];
to
$email = esc_url_raw($_POST[‘user_email’]); ??
Is the above correct?
Should I use WordPress sanitize_*() class helper functions or esc_attr()?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Sanitizing $_POST input’ is closed to new replies.