Utiliser la variable JS dans l'action de formulaire
<script> var url = foo(); </script>
<form method="POST" action=""+url enctype="multipart/form-data">
NachooCh
<script> var url = foo(); </script>
<form method="POST" action=""+url enctype="multipart/form-data">