i have ilias lms website on our server but we want to hide the form action name in source code and web developer, is there any solution on this matter. it html file.
<form id="form_" role="form" class="form-horizontal preventDoubleSubmission" name="formlogin" action="ilias.php?lang=en&client_id=renv1&cmd=post&cmdClass=ilstartupgui&cmdNode=xv&baseClass=ilStartUpGUI&rtoken=" method="post" novalidate="novalidate">
4
Option 1 (recommended):
Use the PHP session for this, you can store all the required variables like this:
<?php
$_SESSION['lang'] = 'en';
$_SESSION['client_id'] = 'renv1';
...
?>
Now the action of the form can just be “ilias.php” and within that file you get your values back:
<?php
$lang = $_SESSION['lang'];
...
?>
Do not forget to validate and sanitize your input, so for example if ‘lang’ can only be ‘en’ and ‘fr’ you should check for that.
Option 2:
Serialize your variables and put that in the action:
<?php
$action_parameters = ['lang' => 'en', 'client_id' => 'renv1'];
$action = 'ilias.php?parameters='.serialize($action_parameters);
?>
Upon submission you can deserialize the parameters.
Peter van der Leek is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3