I’m building a form where users can upload files to my server. The upload script is in PHP and is secure but I’m unsure how secure my form action is.
At the moment I do the following on submit:
<form id="apply" method="post" enctype="multipart/form-data" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, "utf-8"); ?>">
I’ve read about XSS and the $_SERVER array and how to use htmlspecialchars to secure it.
Is this enough? Should I be doing something else?
Just use
action="", it will POST to the current page.