Pre-filling the Email Field in a Webmail Login Form Using URL Parameters
-
Hello,
I need your help to pre-fill the email field in the login form. Here is the relevant line of code:
<input type="email" name="User" id="User" value="" placeholder="E-mail" />I would like to pass an email address in the URL to pre-fill this field. However, it seems that POST/GET methods are being blocked, and I can't find any option to enable them in the settings.
I'm convinced that what I want to do is possible, because I have another webmail (the one from Plesk) that works this way.
Here is an example of the code I am planning to use to pre-fill the field:
<?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $email = filter_var(trim($_POST["email"]), FILTER_SANITIZE_EMAIL); // Redirect to the webmail with the pre-filled email address header("Location: https://case-postale.ch/?User=" . urlencode($email)); exit(); } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Webmail Redirection</title> </head> <body> <form method="post" action=""> <label for="email">Enter your email:</label> <input type="email" id="email" name="email" required> <button type="submit">Submit</button> </form> </body> </html>Thanks in advance for your help!
-
Jonathan Staff
-
-
Jonathan Staff
-
-
Jonathan Staff
-
Jonathan Staff
-
-
Jonathan Staff
-
-
Jonathan Staff
-
-
Jonathan Staff
