How to read a user's /var/mail/ file?
Posted: Thu Dec 31, 2009 2:42 pm
I am trying to write a script that takes a username (corresponding with a user on the server) and then reads the appropriate /var/mail file for that user and prints it.
I've already tried something like
but it returns a blank page with only a "4" printed.
I've already tried something like
Code: Select all
<?php
$username = $_POST["username"];
$output = shell_exec("cat /usr/mail/$username");
echo $output;
?>